public class F { private String first; protected String name; public F( ) { } pu
ID: 3627463 • Letter: P
Question
public class F{
private String first;
protected String name;
public F( )
{ }
public F(String f, String n)
{
first = f;
name = n;
}
public String getFirst( )
{
return first;
}
public String toString( )
{
return ( "first: " + first + " name: " + name );
}
public boolean equals( Object f )
{
if ( ! ( f instanceof F ) )
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( );
}
The G class inherits from the F class. Code the class header of the G class.
// your code goes here
Explanation / Answer
public class G extends F{
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.