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 changeNameString 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
return name Age age;
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
