jawatch java wrote:Thanks for reply.
I m sorry , still not clear on 2nd doubt.
My doubt is why clone() is not visible there ?
The part of the rules of protected access that allow a subclass to access the member only apply when accessing a member of the current object. We can't use them to access a protected member of any old object just because we happen to be a subclass of that object's class.
Yes ! i tried and this time compiler showed error .
How it happened !!?? I just changed the packages .
It seems protected keyword is visible to inherited class objects irrespective of package and not to the base class object.
To base class object it will act as default access specifiers.
I guess now i understood.
Thanks much Jeff and Gaurangkumar for the example .