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 hashmap and hashtable?
Explain the advantages and disadvantages of detached objects.
What is the difference between long.class and long.type?
Are there books about seam?
How is a java object message delivered to a non-java client?
Why a client should be multithreading? Explain.
What class is the top of the awt event hierarchy?
What event results from the clicking of a button?
What is the difference between the string and stringbuffer classes?
What is TL and its use?
What is aop(assepct oriented programing)?
Can I use javascript to submit a form?
Why are my checkboxes not being set from on to off?
How many times may an objects finalize() method be invoked by the garbage collector?
Where we can write Rmi registry in the code, without having to write it at the command prompt?