A typical "setter" for <code>private int age;</code>
- A
private void setAge(int a) { age = a; }
- Bcheck_circle
public void setAge(int a) { age = a; }
- C
public void setAge() { age = 0; }
- D
public int setAge(int a) { age = a; }
Explanation
Setters return void and take a parameter for the new value.