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
How do you ensure that n threads can access n resources without deadlock?
Does substring create a new object?
Explain java coding standards for constants?
What is the synonym of procedure?
What is a programming object?
Why wait(),notify(),notifyAll() methods defined in Object class althought we are using in only threads.
How variables are declared?
Is arraylist ordered?
What function extracts specified characters from a string?
Difference between method overloading and overriding.
Can we make main() thread as daemon?
Name container classes in java programming?
What are the different approaches to implement a function to generate a random number?
What are the types of java languages?
Can singleton class be serialized?