Question: Given the class Test that contain the method main, complete the missing method in the class Doctor to get the expected output as defined in
Given the class Test that contain the method main, complete the missing method in the class Doctor to get the expected output as defined in the box. in Object-oriented programming 
public class Doctor implements comparable private int ID; private int age; private String name; public Doctor (int id, string name, int age ) { this.ID = id; this.name = name; this.age=age; } public int getId() {return ID;} public String getName() {return name; } @Override 1 } public class Test { public static void main(String[] args) { Doctor sl = new Doctor (4350011, "Ahmad", 35); Doctor s2 = new Doctor (4350010, "Abdullah", 30); if($1.compareTo (52) 0) System.out.println("Doctor s2 is younger than s1"); else System.out.println("Both Doctor have the same age"); 1 Output is: Doctor s2 is younger than si
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
