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
Do I need java for windows 10?
What is keyword and identifier?
Difference between keyword and identifier.
Can you call a method on a null object?
What is java string pool?
Is math an abstract class in java?
How will you get the platform dependent values like line separator, path separator, etc., ?
Is null == null in java?
Can we override constructor in java?
What is string subsequence method?
Which is the best approach for creating thread ?
Discuss about garbage collector in Java.
What is the different types of functions?
what is use of functional interface in java 8?
What is a jagged array in java?