Question
Construct a interface ID with the methods: setID(String strID); getID(); boolean validateID(String strID); //Verifies id ID is valid Desing abstract class human with attributes name
Construct a interface ID with the methods:
setID(String strID);
getID();
boolean validateID(String strID); //Verifies id ID is valid
Desing abstract class human with attributes name , weight and age. The constructor will assign values with to this attributes. Also will have sets and gets. Also it have the abstract method talk() which don't receive any arguments or return value. Also a method toString will return the values of the attributes.
Construct abstract class IDCard which implements interface ID. The class will have String cardID. The constructor will allow to assign values with to this attributes
Construct the class Student who inheritance human class and implements interface ID. Will have 2 attribute String mayor, StudentID. Also the Attribute studentDebitCard from the class IDCard. The constructor will receive name, mayor, StudentID,weight and age. In the constructor the object StudentDebitCard will be created with an Empty String ID . The class will implements setStudentDebitCardID() and getStudentDebitCardID() to set and obtain studentdebitcard. The class will also implements the method talk() wich is inheritance from human and print the string on screen. Also the method tostring will print
Finally, construct a main which will create the object student and demonstrate all the classes and interfaces work.
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