You don’t have access to a protected member of Object in that class.
The problem is not about clone() but about protected access. You can read about clone() here. It’s the old edition. You can find the new edition by looking through our book review pages.
Joined: Oct 13, 2005
Piotr Majcher wrote:. . . So if you move your file to java.lang package, your code will compile fine. . . .
Piotr Majcher wrote:Hi,
protected method can be invoke only in inheritance tree or inside a package.
So if you move your file to java.lang package, your code will compile fine.
Perhaps it is not good idea
thanks for the reply,please tell me can't we invoke protected methods out side the package if we inherit them.And
each class inherits "Object"