Question: IF I Liv: Introauction to Java Technologies home > 7 . 4 : Mutators, accessors, private helpers ACTIVITY 1 . 4 . 2 : Mutators,

IF I Liv: Introauction to Java Technologies home >7.4: Mutators, accessors, private helpers
ACTIVITY
1.4.2: Mutators, accessors, and private helpers.
5280403489528.93 zay 7
Jump to level 1
Define the Student class's getName() accessor that gets field name and the getAge() accessor that gets field age. Ex: If the input is Ron 16, then the output is:
Student: Ron
Age: 16 years old
StudentInfo.java
public class Student {
private String-name;
private int age;
public void setNam(String inputName){
name = inputName;
}
public void setAge(int inputAge){
age = inputAge;
}
Y* Your code goes here */
}
1
2
3
4
 IF I Liv: Introauction to Java Technologies home >7.4: Mutators, accessors,

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!