can a static method be overridden

Answer Posted / narasimha rao bodagala

Hi rama devi,u are written the answer is ok but not clear
i given one example of this

what i am saying is the static methods are not overriden
cause the class loader will load the while loading the
class at runtime so the compiler will check the which
static method would i need to call co its confused thas's
why the static methods are not overriden.

EXAMPLE:

class A {
static void something () {}
}

class B extends A {
static void something () {}
}

....
A anA = new B ();
anA.something ();

think and compile what's the comipler say's.

Is This Answer Correct ?    18 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the types of scaling?

560


What is the difference between the session.get() method and the session.load() method?

604


What is TL and its use?

1993


What are the oops concept?

581


How can I scroll through list of pages like the search results in google?

573






What are the pros and cons of detached objects?

549


What happens when a thread cannot acquire a lock on an object?

543


In inglish: How to convert jar to exe files? Em português: Como converter arquivos .jar para .exe?

2158


What modifiers may be used with an interface declaration?

561


What do you mean by Socket Programming?

551


Can I map more than one table in a cmp?

593


Why use a datasource when you can directly specify a connection details?

534


Why use a datasource when you can directly specify a connection details? (in a J2EE application)

3461


What is the difference between the session.update() method and the session.lock() method?

560


What is table mutation and how do you avoid it?

1919