Accessing Non Static Members in Java ApplicationĀ | Java Tutorials

This Java Tutorials “Accessing Non Static Members in Java Application” is providing information about how to access static members from different contexts of Java application using class name, object reference variable and this keyword.


 

Access Non static members from Static context:

 

 

Access Non static members from Non Static context:

 

Note : In the above application, we are creating 2 objects(waste of memory). It is recommended to create only one object globally(static).

 

Share this