Question: package DoctorWho; class TimeTraveller { static int age; public String name; protected char gender; } package DoctorWho; public class Doctor extends TimeTraveller { private int

package DoctorWho;

class TimeTraveller

{

static int age;

public String name;

protected char gender;

}

package DoctorWho;

public class Doctor extends TimeTraveller

{

private int number;

protected String companion;

String uniqueItem;

}

package DoctorWho;

public class TVShow

{

Doctor Who = new Doctor();

}

Given the code above, what variables in the instantiated Doctor object can be accessed without mutators or accessors? and why?

Answers:

age

name

gender

number

companion

uniqueItem

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!