Monday 16 March 2015

Q 13) Understanding Static ?




Static variable :

1.   The variable which is declared with a static keyword is known as static          variable.
2.     It will be initialize at class loading time.
3.     We can use the static variables in a different class without creating an            object reference.
4.     It can be called by its class name.
     Eg : classname.method() or classname.variable.
5.    We cannot use this keyword for static variable or static method



No comments:

Post a Comment