What is basic concept of static in java ?

Answer Posted / narayanarao bp

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.

Is This Answer Correct ?    15 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What happens to the Exception object after handling an exception?

1922


How does java pattern compile work?

635


Give a practical example of singleton class usage?

672


What is main in java?

621


What is the final field modifier?

631






What is nested top-level class?

669


What about abstract classes in java?

703


Give any two differences between C++ and java.

653


How do I type unicode?

631


What is the byte range?

681


What do you mean by a JVM?

668


What is parameters example?

646


How do you sort an array in java?

631


What are alternatives to java serialization?

689


What is the effect of keeping a constructor private?

565