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
Who developed java?
Why do we need data serialization?
How many bytes is a url?
Name some OOPS Concepts in Java?
Explain the importance of finalize() method.
Can a class have a static inner class?
What is difference between string and stringbuffer?
Which is faster set or list in java?
Is null == null in java?
Can we have this () and super () together?
Can long be null in java?
Write a method that will remove given character from the string?
Can we sort set in java?
How to perform linear search in java?
Is simpledateformat safe to use in the multithreaded program?