Given the following class. (JAVA) public class FamilyMember { public String drink( ) {return “cup”;} public String eat( ) {return “fork”;} } Write a Baby class that is derived from the FamilyMember...


Given the following class. (JAVA)



public  class  FamilyMember


{


    public String drink( ) {return “cup”;}


    public String eat( )     {return “fork”;}


}



Write a
Baby class
that is derived from the FamilyMember class. The Baby class has an
instance variable
for the age, a
default constructor, and a
constructor that accepts an integer. Include
any other necessary methods. If a baby is older than 3 years, print that “it eats with its fork”; otherwise, “it eats with its hands”.



Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here