Question: Given the following class; the Person class is defined elsewhere: public class Book { private Person author; public Book () { author = null; }
Given the following class; the Person class is defined elsewhere: public class Book { private Person author; public Book () { author = null; } //other fields, constructors, and methods would be defined here public Person getAuthor() { return author; } public void setAuthor(Person auth) { author = auth; } } Is anything wrong with the getAuthor method? Explain. If something is wrong with the method, rewrite getAuthor().
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
