This week's book giveaway is in the Other Open Source APIs forum. We're giving away four copies of Storm Applied and have Sean Allen, Peter Pathirana & Matthew Jankowski on-line! See this thread for details.
The rule of method overridding says that "The overridding Method can not be less accessible than the overridden method" Hence a private method can be overidden by "friendly, protected ot public methods. However, the private methods can not be overridden. Also abstract methods can not be private. Can someone explain this concept? Thanks.
Sorry, but U are interpreting the sentence in a wrong way. The statement says, no method can be overridden to be less accessible i.e. you can't make a method protected if it was public originally, or you can't make a method private from protected etc. so please make your interpretation correct. hope to help you. raghav.. [This message has been edited by Raghvendra Sharma (edited October 12, 2000).]
So u see Mukesh that u can't access the private methods in derived class.and since u can't access them so when u define a method with the same name in the derived class u r definitely not ovrriding the base class function. instead such a situation u r said to be hiding the base class function. ----------------------------------------- for your next doubt abstract methods can not be private. as must be clear from the above text that private methods - are not available in derived class and abstract methods - have have to be available in the derived class because they are meant to be implemented by the derived class somewhere down the line. so don't you think that the feature/requirements of private and abstract modifires are so contrdictory that nobody would need/wish to use them together. so it's defined illegal by java lang. what do u think now? regards deekasha