Originally posted by h kumar: 1.my question is can we have the same or different access specifiers(like private or public for the methods definition) for the overloading and overriding?
Overloading creates a completely new method that just happens to have the same name. Therefore you can do anything with it - except give it the same parameter list as the overloaded method.
For overriding you can only make a method more public. You can't override private methods (the sub class doesn't know anything about them, you'll redefine them instead), but methods with default access can become protected or public, and protected methods can become public. Public methods can't become protected though.
2.can a method overloaded in its subclass ?
Overloading can happen even in the same class because of what I said before. [ October 08, 2007: Message edited by: Rob Prime ]