Construct a interface ID with the methods: setID(String strID); getID(); boolean validateID(String strID); //Verifies id ID is
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 , 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.
Java How To Program Late Objects Version
ISBN: 9780136123712
8th Edition
Authors: Paul Deitel, Deitel & Associates