Back to Top

Sunday, 15 January 2012

JAVA : What is static in java?

  Static means one per class, not one for each object no matter how many instance of a class might exist. This means that you can use them without creating an instance of a class.Static methods are implicitly final, because overriding is done based on the type of the object, and static methods are attached to a class, not an object. A static method in a superclass can be shadowed by another static method in a subclass, as long as the original method was not declared final. However, you can't override a static method with a nonstatic method. In other words, you can't change a static method into an instance method in a subclass.

6 Responses to “ JAVA : What is static in java? ”

Anonymous said...
9 May 2012 at 13:12

great


Anonymous said...
18 August 2013 at 12:27

When any member of a class is declared as static then it can be accessed without creating any object of the class.
If a variable is declared as static then even if several objects of the class are created but no copy of the variable is made;all the instances share the same static variable.
If a method is declared as static then that method can access only static data,it can invoke only static methods and it can't use "this" and "super" keyword.
So normally a class member is accessed with the help of an object of a class.But by using static it is possible to access them without creating an object.


Naviya Nair said...
24 October 2016 at 15:00

I have read your blog its very attractive and impressive. I like it your blog.

Java Training in Chennai Java Training in Chennai | Core Java Training in Chennai

Online Java Training Java 8 Online Training | Java J2EE Online Training | JavaEE Training Institute in Chennai Java Training Institutes

Java Training Institutes in Chennai Java Training in Chennai


Anonymous said...
25 May 2017 at 16:05

this is very useful for every one who want to learn about static keyword with easy steps and in detail also.
thank you


sumant kumar said...
29 August 2018 at 18:30

I found best article.thank you for sharing useful info.
visit
web programming tutorial
welookups


Praveen H said...
28 October 2018 at 22:19

nice article thank you.
For java interview programs visit: Java programming


Post a Comment

Popular Posts

Subscribe via Email
Subscribe Java Interview Questions via Email
All Rights Reserved JAVA INTERVIEW QUESTIONS | Privacy Policy | Anijit Sarkar
blog links Web Directory Academics Blogs