Question: QUESTION 13 The class Doctor has two fields: MPN is of type int and doctor_name is of String type. Two Doctor objects are equal if

 QUESTION 13 The class Doctor has two fields: MPN is oftype int and doctor_name is of String type. Two Doctor objects are

QUESTION 13 The class Doctor has two fields: MPN is of type int and doctor_name is of String type. Two Doctor objects are equal if both MPN and doctor_name values are identical. Assuming the parameter varaible is ob, which is the code required in the overriden equals method of Doctor class? O Doctor other = (Doctor) ob; return this.doctor_name.equals(other.doctor_name); return this.MPN == ob.doctor_name; O Doctor other = (Doctor) ob; return this.MPN == other.MPN && this.doctor_name == other.doctor_name); O Doctor other = (Doctor) ob; return this.MPN == other.MPN; Doctor other = (Doctor) ob; return this.MPN.equals(other.doctor_name); O Doctor other = (Doctor) ob; return this.MPN == other.MPN && this.doctor_name.equals(other.doctor_name); O Doctor other = (Doctor) ob; return this.MPN.equals(other.MPN) && this.doctor_name.equals(other.doctor_name); Doctor other = (Doctor) ob; return this.MPN == doc.MPN && this.doctor_name.equals(doc.doctor_name); O if (this == ob) return true; if (this != ob) return false; O Doctor doc = (Doctor) ob; return MPN == doc.name; QUESTION 3 Super class Xclass has 1 public field, 1 private field and 2 protected fields; its subclass Zclass declares 1 new public field and 2 new private fields. How many fields does Zclass have full access to? 3 4 5 7 other

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!