Answer:
public class Class {
private String name ="";
private int score = 0;
//Method SetName
public void setName(String newName){
name = newName;
}
//Method SetScore
public void setScore(int newScore){
score = newScore;
}
//Method GetName
public String getName() {
return name;
}
//Method GetScore
public int getScore() {
return score;
}
}
Step-by-step explanation:
- The class called Class is implemented in Java programming language
- It has two fields (instance variables name and score)
- Methods for setting the values of variables (mutator methods) or setters
- Methods for getting the values of the variables (accessor methods) getters