Question: public class Person { private String name = null; public Person ( String theName ) { name = theName; } public String getFood ( )
public class Person
private String name null;
public PersonString theName
name theName;
public String getFood
return "Hamburger";
public static void mainString args
Person p new StudentJavier;
System.out.printlnpgetFood;
class Student extends Person
private int id;
private static int nextId ;
public StudentString theName
supertheName;
id nextId;
nextId;
public String getFood
String output super.getFood;
return output and Pizza";
public int getId
return this.id;
public void setIdint theId
this.id theId;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
