Thursday, January 3, 2019

Static is a keyword in Java, which is used for
    1. static blocks
    2. variables
    3. methods and 
    4. inner classes or nested classes
  • A static member can be accessed directly with the class name with out creating an object. 
  • The value of the  static variable is shared by all objects of a class means same set of copy available to all the objects.
  • If any variable is modified by an object those changes visible to every object. Static content doesn't belongs to any particular instance or object.
Static can not be used for Outer most class class. Why?
  1. Every class is already common to all the objects. No need to make class static to become available to all the objects
  2. A class is belongs to package level. Class can be accessed directly with <package_name.ClassName>. No need to make class as static.

0 comments:

Post a Comment

selenium-repo by venu

Blog helps to a student or IT employee to develop or improve skills in Software Testing.
For Online Classes Email us: gadiparthi122@mail.com

Followers

About Me

My photo
Hyderabad, Andhra Pradesh, India
I am Automation Testing Professional. I have completed my graduation in B.Tech (Computers) from JNTU Hyderabad and started my career in Software Testing accidentally since then, I passionate on learning new technologies

Contact Form

Name

Email *

Message *

Popular Posts