Write an application namedUseChildrenthat creates and displays at least two Childobjects—oneMaleand oneFemale.Childis an abstract class andMaleand Femaleare subclasses. TheChildclass contains fields...



Write an application namedUseChildrenthat creates and displays at least two Childobjects—oneMaleand oneFemale.Childis an abstract class andMaleand Femaleare subclasses. TheChildclass contains fields that hold the name, gender, and age of a child. TheChildclass constructor requires a name and a gender. The Childclass also contains two abstract methods namedsetAge()anddisplay().



TheMaleandFemalesubclass constructors require only a name; they pass the name and appropriate gender to theChild. The subclass constructors also prompt the user for an age using thesetAge()method, and then display the Child’s data using thedisplay()method. Save the files as Child.java, Male.java, Female.java, and UseChildren.java.



Sep 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here