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 are the elements of java?
What are the disadvantages of using inner classes?
What is the difference between static class and normal class?
What is t in generics in java?
Is minecraft java edition free?
Differentiate jar and war files?
Explain constructors and types of constructors in java.
Is there any way to skip finally block of exception even if some exception occurs in the exception block?
Can sleep() method causes another thread to sleep?
What is constructor in java ?
How does thread synchronization occurs inside a monitor? What levels of synchronization can you apply?
What is the use of private static?
Explain about transient variables in java?
What are disadvantages of java?
What is tochararray in java?