Hi... I havnt seen those sites but let me tell you what I know abt static methods...
you must be knowing that static methods are called using the class name and not object of that class <ClassName>.staticMethod() ...ok ..fine...so if I override a static method , still which method gets called will be decided upon class name..... it is possible to call static methods by using object name.....thats correct and legal...but why would you do that in first place?... Anyways , if you use object to invoke static method , basic rules of OVERRIDING is not applicable... it means you cannt override static method IN REAL SENSE.... Same is the case with method declared as FINAL....you cant override them...only difference is that, in this case compiler complains.... Hope this was helpful... regards, Mayur On Fri, Aug 29, 2008 at 4:24 AM, Gagan Arora <[EMAIL PROTECTED]> wrote: > Hey All, > > Inheritance pdf contains... > > Slide 36 talk about how overriding a static method is "HIDING" for real > .... > Later on Slide 50, its written static methods are automatically final i.e. > they cannot be overridden. > Aren't these two statements going on separate directions and contradicting > each other ... > > Thanks, > G > > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en -~----------~----~----~----~------~----~------~--~---
