Scope

  • Eclipse: Oxygen
  • Java: 1.8

The scope of the variable is defined by the passage of the variable in which it can be used and accessed. The scope is an important concept in the OOPS. We have learned that public, private, protected and default which is the package. These are the scope operators which operate on a variable to decide their existence in various parts of the code.

App class

Output

8
9
**********
10

Contributed by: Poonam Tomar


VIEW COURSES

Buy me a coffee!

 

PayTM QR (INDIA)

  • Get video tutorials
  • Project files set
  • Get┬áCertified

Leave a Reply

avatar
  Subscribe  
Notify of
Close Menu