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
difference between ejb,struts,hibernate,spring and jsp
What is the RMI and Socket?
Where we can write Rmi registry in the code, without having to write it at the command prompt?
which type of objects reference will be given to client?
What is the highest-level event class of the event-delegation model?
What is the map interface?
What is the infobus?
In our urls and in the text of the buttons we have comma. Its causing an error. Is there a way to change the delimiting character for the menu arguments?
the same information whether it will connect to the database or it will be used previous information?
Describe activation process?
What’s jboss cache in short?
Can I run seam with jdk 1.4 and earlier?
How to pass parameters in RMI?
What is the difference between the session.update() method and the session.lock() method?
Explain what is orm?