answersLogoWhite

0

== == Static method cannot be overwritten because it belongs to the class and not to the Object

If you're asking about overriding or overloading, then yes. Static methods can be overridden and overloaded just like any other methods.

User Avatar

Wiki User

15y ago

What else can I help you with?

Continue Learning about Engineering
Related Questions

How do you access the static variable and static methods of a class?

In java we access static variables and static methods without creating objects. i.e.,we can access directly by using classname we can also access static variables and static methods by using objects which are created by using class where the static variables and static methods are available


Are static variable created by giving keyword static in java?

yes bcoz static variables


What is static java most commonly used for?

Static java method is the same as a static variable. They belong to a class and not an object of that class. If a method needs to be in a class, but not tied to an object, then one uses static java.


WAP to show the difference between a variable and static variable?

difference between constant and static variables in java


What are static objects in java?

There is no separate entity as a static object in java. The static keyword in java is used to signify that the member (either a variable or a method) is not associated to an object instance of the class. It signifies the fact that the member belongs to the class as a whole. The words static and objects are opposites of one another so you cannot have a static object. However, you can declare an object as a class level variable which could be referred to as a static object but it will be referred to as a static or class variable and not a static object.


Can you interchange the term public and static in java?

The two are different, and independent from one another. A variable can be public, static, both public and static, or neither.


Can a method be static and synchronized?

Yes. In Java methods can be static and synchronized. Static methods access other static members in the class. Static in case of inheritance are treated as non - static. Synchronized methods are those which have dedicated thread attached to it and no other can access until currrent thread leaves the control from it.


Can you inherit static method in java?

Yes. While it is sometimes considered bad style to override static methods, you can treat them like any non-static methods when it comes to inheritance topics.


What does the 'this' reference do in Java?

Represents the current object (not usable in static methods).


Which one executed first static block or static methods in java?

Static Blocks are always executed first. A static block is executed when your class is charged but a static method is executed only when is called, therefor first the class is charged and then is executed a method.


Can you overload static methods in Java?

Yes you can overload the static method. But it should be avoided because memory to static methods are allocated at the time of class load.....so memory will be wasted if we don't use that methods. Whereas non-static method memory allocation depends on Object


What is public static final variable in java?

-Public to all - Static to access with Class Name - Final to change( constant and not alowed to change) Just use it along with class name. (As implied above, a 'public static final' variable in Java is what other languages would call a Constant. )