can a static method be overridden
Answer Posted / kiran sangeri
no,bcos look at below code
package test;
class A {
static void something () {
System.out.println("class A");
}
}
class B extends A {
static void something () {
System.out.println("class B");
}
}
public class ClassC {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
A anA = new B ();
anA.something ();
}
}
Output : class A
so Class A is not been overridden.
Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
Are enterprise beans allowed to use thread.sleep()?
Define the remote object implementation?
What is the relationship between an event-listener interface and an event-adapter class?
What is re-entrant. Is session beans reentrant. Is entity beans reentrant?
What is mdb and what is the special feature of that?
What is ripple effect?
What are the pros and cons of detached objects?
Are we allowed to change the transaction isolation property in middle of a transaction?
What is Remote Server?
What is the purpose of the notify() method?
Explain how will the struts know which action class to call when you submit a form?
In RMI, inorder to sent the stub reference to the client, is we have to load the server object first into the memory or can we directly sent reference to the client?
How to pass parameters in RMI?
What is jboss?
What are the benefits of detached objects?