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
How is hashset defined in java?
Why do we create public static method in java?
What is wrapper class example?
How are this() and super() used with constructors in java programming?
Is it possible to specify multiple jndi names when deploying an ejb?
What are the wrapped, classes?
What are some examples of variable costs?
What will happen if there is a default method conflict as mentioned above and we have specified the same signature method in the base class instead of overriding in the existing class ?
Which programming language is most secure?
Is java developer a good career?
Can vector have duplicates in java?
Considering notepad/ie or any other thing as process, what will happen if you start notepad or ie 3 times? Where 3 processes are started or 3 threads are started?
What is a class reference?
Why stringbuilder is not thread safe in java?
What is break and continue statement?