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
Can we have try without catch block?
Explain, java is compatible with all servers but not all browsers?
What type of variable is gender?
How many types of the indexof method are there for strings?
Write a program to print all permutations of string?
I want to store more than 10 objects in a remote server? Which methodology will follow?
What is printwriter in java?
Can keyword be used as identifier?
Is string a data type in java?
How can we find the actual size of an object on the heap?
Can we pass null as argument in java?
What is final method in java?
Differentiate between class and structure.
what do you mean by classloader in java?
Which class represents the socket that both the client and server use to communicate with each other?