Can we override static methods?
Answer Posted / amitasite
you cannot override static method from super class.
e.g.,
class SuperType{
public static void method(){
System.out.println("Super Static");
}
}
class SubType extends SuperType{
public void method(){
System.out.println("Super Static");
}
}
It will give compilation error : Instance method cannot
override static method from SuperType
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
What is javac in java?
what is bmg file and how to create that files?what will it contailn?
What is meant by class loader? How many types are there? When will we use them?
Why is multiple inheritance not supported in java?
Why wait(),notify(),notifyAll() methods defined in Object class althought we are using in only threads.
What are the main uses of the super keyword?
What is final method in java?
What is difference between public static and void?
Explain java coding standards for constants?
How do you empty a list in java?
How many types of memory areas are allocated by JVM in java?
Why wait and notify methods are declared in object class?
List the three steps for creating an object for a class?
How will you reverse a link list without using recursion?
What is passing parameters in java?