Girish,
Now I know what you want.
Overriding a method means what? When you create an object from the subclass which does the overriding, the
re-defined (new) behaviour must be kept intact when the method is called on this object right? In other words , there is a base class and it has a method say, void m1() which prints "I like Java". And there is a subclass which is derived from this parent, and it re-defines the beahviour of this inherited method from base class and say, it prints "No I don't like Java". Also lets assume that this method is instance method. So when you create a physical object using Base b = new Base(); and call b.method(), what it will say. Obviously it is real base class object and you would expect it to say "I like Java" Right? Simillarly when you create like this Subclass s = new SubClass(); and call s.method(), it will behave itself

and says "I don't like java". Now lets say we do like this Base b = new Subclass(); Now what do u expect? Since this method is instance method, which is overriden by the subclass, eventhough you see through a mirror and see it's another face of Base class, in case of overriding a method, the true face of the
overriden method only will be seen. This is oop. Now also it will say "No I don't like Java';
In order to analyze the static concept, let us take the same case as described above. Let's assume Both Base class and subclass has their own version of static void method(); This means what? Each class as a independent class of its own wants to give a COMMON behaviour for all objects created from them. This means when the subclass redefines the same static void method1(), it DOES NOT OVERRIDE. It hides. In the sense, If you apply the same 2 tests as shown above Base b = new Base(); b.method() WILL call Base class version. Subclass s = new Subclass(); s.method() WILL call subclass version. And you know waht? Base b = new Subclass() WILL NOT CALL SUBCLASS VERSION. IT WILL CALL THE BASE CLASS VERSION of the static method. Seeing a subclass object through a base class mirror and when we see a static method, the MIRROR type's static only will be seen. So the mirror beahves differently.

So do you get the point? If the static method WOULD HAVE BEEN OVERRIDEN we MUST see the subclass version right? Then why we see the static base class method? So static method are NOT OVERRIDEN.
For the compiler part, it does say anything about the 'hiding' IT throw s the same error for both instance and static methods. It DOES NOT DISTINGUISH between hiding and overring
when it throws the error But it does its work fine.

regds
maha anna
[This message has been edited by maha anna (edited April 20, 2000).]