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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!