Question: / / ? * * * * * * * * * * * * * * * * * * * * * *

//?****************************************** Person.java // A simple class representing a person.
public class Person
I
private String name;
private int age;
II
age.
II
//
public Person (String name, int age)
&
this. name = name;
}
this.age = age;
II
// chanasc the name of the Person to the parameter newName.
//-
public void changeName(String newivarie)
{
name = newName;
}
II
// chanas the age of the Person to the parameter newAge.
//-
public void changeAge (int newAge)
{
age = newAge;
}
//
// Raturns the person's name and age as a string.
//-
public String toString()
1
return name +"- Age "+ age;
}
 //?****************************************** Person.java // A simple class representing a person. public class

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!