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


Please Help Members By Posting Answers For Below Questions

How task's priority is used in scheduling?

1786


what are RemoteObjects?

2262


What is a session? Can you share a session object between different theads?

558


what is an isolation level?

2216


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?

1930






Which class is the immediate superclass of the menucomponent class?

635


What’s jboss cache in short?

604


What is JTS?

1864


How are the elements of a cardlayout organized?

597


What are the sequence of steps to write pub or sub model kind of application?

1895


What are the oops concept?

581


What is metaspace?

552


Do I have to use jsps with my application?

585


If your ui seems to freeze periodically, what might be a likely reason?

550


What does module-relative mean?

581