Can static methods be overridden?
Answer Posted / sumit pal singh
static class Class1 {
public static int Method1(){
return 0;
}
}
static class Class2 extends Class1 {
public static int Method1(){
return 1;
}
}
public static class Main {
public static void main(String[] args){
Class1.Method1();
Class2.Method1();
}
}
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
Which is the best sorting technique in java?
What is object-oriented paradigm?
Is java free for businesses?
Where is core java used?
hr interview how many minutes asking question
Explain about exception propagation?
When should I use singleton?
What is the relationship between class and object?
is it possible to instantiate the math class?
What is autoboxing and unboxing?
Can singleton class be inherited in java?
what is object slice?
When throws keyword is used?
What is rmi and steps involved in developing an rmi object?
How hashmap increases its size in java?