asked 36.3k views
0 votes
Local variables:

A. Lose the values stored in them between calls to the method in which the variable is declared
B. May have the same name as local variables in other methods
C. Are hidden from other methods
D. All of the above

1 Answer

6 votes

Answer:

The correct answer for the given question is Option(D).

Explanation:

A local variable is those which are declared inside the method. The scope of the local variable is local means it will access only that function. They are not accessed outside the function.

There are some features of Local variable which are given below:

  • The local variable is hidden from the other function.
  • The local variable sometimes have same name as the global variable

So all Option(a),Option(b) and Option(c) are correct.

answered
User Bob Snyder
by
8.4k points

No related questions found