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
Explain about fail safe iterators in java?
Is java a compiler?
How does compareto method work?
How do you check if a number is a perfect square?
What is java autoboxing?
Write a program to check for a prime number in java?
How will you reverse a link list without using recursion?
What is method overloading with type promotion?
Is boolean a wrapper class in java?
Explain the selection sort algorithm?
What is a java lambda expression?
What is the use of private static?
What is re-factoring in software?
What is an object’s lock and which object’s have locks?
What is difference between static variable and global variable?