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
How task's priority is used in scheduling?
what are RemoteObjects?
What is a session? Can you share a session object between different theads?
what is an isolation level?
we use MainFrame and using os390 for operating system with DB2 data base in IRAN and interest programing with java and use webspere for world wide,please help me where i should start?
Which class is the immediate superclass of the menucomponent class?
What’s jboss cache in short?
What is JTS?
How are the elements of a cardlayout organized?
What are the sequence of steps to write pub or sub model kind of application?
What are the oops concept?
What is metaspace?
Do I have to use jsps with my application?
If your ui seems to freeze periodically, what might be a likely reason?
What does module-relative mean?