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
When throws keyword is used?
define polymorphism in java
Can we have a method name same as class name in java?
Discuss 2D arrays.
Why is serialization required?
Can we rethrow the same exception from catch handler?
What is data structure in java?
What is the difference between jfc & wfc?
What is a null point?
What is a byte string?
Detail discussions on JVM, memory management and garbage collector.
Can a final variable be null?
Can we instantiate interface in java?
Why spring singleton is not thread safe?
What does business logic mean?