use java zyBooks My library COMP 2150 home s 101: Derived classes E zyBooks cata
ID: 3747132 • Letter: U
Question
use java
zyBooks My library COMP 2150 home s 101: Derived classes E zyBooks catalog Help/FAQ e Alex CHALLENGE101.2 Basic inheritance ACTIVITY courseStudent's name with Smith, age with 20, and ID with 9999. Use the print member method and a statement to output courseStudents's data Sample output from the given program Name: Smith, Age: 28, ID: 9999 1 Code fron file PersonData. java 2 public cless PersonData ( 3 private int ageYears; 4 private String lastNane 6 public void setNane(String userlane) f ssset 18 publc void setAge(iot nunYears) t 12 13 14 Other parts onitted 15 16public vold printAl11O 17 18 System out.print ("lanelastlame)s System-out "print(", Age: -:; t ageYears); 28 1 Run View your last submissionExplanation / Answer
courseStudent.setName("Smith");
courseStudent.setAge(20);
courseStudent.setID(9999);
courseStudent.printAll();
System.out.print(", ID: "+courseStudent.getID());
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.