
724 CHAPTER 10 Object-Oriented Programming,Part 3: Inheritance,Polymorphism,and Interfaces
EXERCISES,PROBLEMS, AND PROJECTS
return false;
else
{
F objF = ( F ) f;
return( first.equals( objF.first ) && name.equals( objF.name ));
}
}
public interface I
{
public static final String TYPE = ”human“;
public abstract int age();
}
21. The G class inherits from the F class. Code the class header of the G class.
// your code goes here
22. Inside the G class, which inherits from the F class, declare a private
instance variable for the middle initial and code a constructor with
three parameters, calling the constructor of the F class and assigning
the third parameter, a ...