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 difference between equals and hashcode method?
Explain about automatic type conversion in java?
Can you explain the usages of class.forname()?
Can we have multiple public classes in a java source file?
What is floor in java?
When do I need to use reflection feature in java?
What is a functional interface?
Define class?
How do I get the | symbol on my keyboard?
What is tochararray in java?
Which is easier netbeans or eclipse?
Explain about doubly linked list
What must a class do to implement an interface in java programming?
Is there any difference between synchronized methods and synchronized statements?
How objects are stored in java?