Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started