This one is weird. I have the following code:
class A
{
protected A clone() throws CloneNotSupportedException
{
return (A) super.clone();
}
}
when I de-compiled its bytecode through 'showmycode.com', it showed me the following code:
class A
{
A()
{
}
protected A clone()
throws clonenotsupportedexception
{
return (A)super.clone();
}
protected volatile object clone()
throws clonenotsupportedexception
{
return clone();
}
}
What does it mean for a method return type to be volatile in the second 'clone' method? (This code was compiled through Eclipse's default JDK 1.6 compiler).