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
What is the properties class in java programming?
whatis Home interface and Remoteinterface? with example?
can any body body expalin best definitions & best real time exaples for opps concepts.
What if static is removed from main method?
How does map works in java?
Can constructor return value?
do I need to use synchronized on setvalue(int)? : Java thread
Explain different types of thread priorities ?
What is size of int in java?
what is the purpose of the runtime class?
What is a byte string?
Difference between a class and an object?
What is variable explain?
Why java is considered dynamic?
What is difference between identifier and variable?