Question
**IN JAVA** Define a class Diploma and its subclass DiplomaWithHonors, so that the statements Diploma diploma1 = new Diploma(Murray Smith, Gardening); System.out.println(diploma1); System.out.println(); Diploma diploma2
**IN JAVA**
Define a class Diploma and its subclass DiplomaWithHonors, so that the statements Diploma diploma1 = new Diploma(Murray Smith, Gardening); System.out.println(diploma1); System.out.println(); Diploma diploma2 = new DiplomaWithHonors(Lisa Smith, Evolutionary Psychology); System.out.println(diploma2); System.out.println(); Display This certifies that Murray Smith has completed a course in Gardening This certifies that Lisa Smith has completed a course in Evolutionary Psychology *** with honors *** Make your class definitions consistent with the information-hiding principle (declare fields as private) and avoid duplication of code. Write THREE classes: Diploma, DiplomaWithHonors, and DiplomaTest (or Main).
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