[Java] Main.java

less than 1 minute read

class Main { public static void main(String[] args) { // Make your job a “doctor” Person person1 = new Person(“Kate”, “Jones”, 27, 1.6, 50.0, “Doctor”); person1.printData(); // Make your job a “teacher” Person person2 = new Person(“John”, “Christopher”, “Smith”, 65, 1.75, 80.0, “teacher”); person2.printData(); System.out.println(“———————-“); // Change the job of person1 to “veterinarian” person1.setJob(“veterinary”);

 // Please output as "I changed the job of person1 to ◯◯"
 System.out.println("Person1 job changed to "+person1.getJob()+"");

 person1.printData();    } } 

Tags:

Updated: