Question: java Suppose name is a private String. Which of the following is its accessor (get) method? A public void getName() { System.out.println(name); } () public
Suppose name is a private String. Which of the following is its accessor (get) method? A public void getName() { System.out.println(name); } () public void getName(Srting n){ name = n; } public String getName() { return name: } public String getName(String n) { return n; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
