Question: In the code below, setName ( ) uses the keyword this to explicitly refer to the [ Select ] variable that is shadowed by the

In the code below, setName() uses the keyword this to explicitly refer to the
[ Select ]
variable that is shadowed by the
[ Select ]
variable.
5 public class Account
6{
7 private String name;
8
9//Method to set the name in the object.
10 public void setName(String name)
11{
12 this.name = name; //Store the name.
13}
14
15//Method to retrieve the name from the object.
16 public String getName()
17{
18 return name; //Return value of name to caller.
19}
20}//END CLASS Account

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!