English

State True or False. A local variable can exist outside its method as well.

Advertisements
Advertisements

Question

State True or False.

A local variable can exist outside its method as well.

True or False
Advertisements

Solution

This statement is false.

Explanation:

A local variable cannot exist outside its method. It is created when the method starts execution and is destroyed when the method ends. It can be accessed only within the method where it is declared.

shaalaa.com
  Is there an error in this question or solution?
Chapter 6: Encapsulation - Exercises [Page 148]

APPEARS IN

Rupa Pandit Computer Applications [English] Class 10 ICSE
Chapter 6 Encapsulation
Exercises | Q 3. (i) | Page 148
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×