If I say
class A{
}
then it implicitly inherits Object class.So I am having the class as below:
class A{
protected Object clone(){
} /// Here i am not overridning
//All the other methods (toString/wait/notify/notifyAll/getClass)
}
Now Why cant I access the clone() method in Class B which is in the same package of class A.
Class B{
A a = new A();
a.clone();
**
}
//** Says clone is protected in Object class . But I am not accessing Object's clone method .Here I am invoking class A's clone method anyway which I havn't overloaded yet.