[Solved]Given Following Person Object Class Answer Questions Follow Public Class Person Protected Q37042795
Given the following Person object class, answer the questionsthat follow.
public class Person {
protected String name;
protected int age;
public Person() {
} public Person(String name, int age)
{
this.name = name;
this.age = age; }
public void play() {
System.out.println(“Out having fun…”);
}
ublic void talk() {
System.out.println(“Hi!”);
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setAge(int age) {
this.age = age;
}
public int getAge() {
return age;
}
public String toString() {
StringBuffer buffer = new StringBuffer();
buffer.append(“nname: ” + name);
buffer.append(“nage: ” + age);
return buffer.toString();
}
}
Write the Java class HmWk12 to test the Student and Pilotclasses written above that inherits the properties of the Personobject. HmWk12 should create at least 1 Student object and 1 Pilotobject, and then output the values for the student and the pilot tothe screen. After displaying the Student object’s data, execute theplay() and talk() methods. After displaying the Pilot object’sdata, execute the play(), talk(), takeoff(), and landing()methods.
Expert Answer
Answer to Given the following Person object class, answer the questions that follow. public class Person { protected String name; … . . .
OR

