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 is use of super keyword in java?

793


What is tree in java?

667


What is java lang object?

730


What things should be kept in mind while creating your own exceptions in java?

848


Can we make constructors static?

932


what methods would you overwrite in java.lang.object class?

741


How do you reverse a string in java without using string buffer?

796


Explain the concept of proper inheritance?

806


What is meant by attribute?

769


How does thread synchronization occurs inside a monitor?

745


What restrictions are placed on method overriding?

851


Can a class have multiple superclasses?

772


What is a class instance variable?

827


Where are local variables stored?

706


What does this () mean in constructor chaining concept?

801