clone()
method is not visible by default in Object
class so how does it does not give error for Array types?
Does this means that there is a type called int[] of which implementation is written in java and if yes where to find it ?
and if it is written then why not write it completely?
I mean why not implement every method properly not just the behaviour from Object
Class.
int[] a ={1,2,3};
Object object = new Object();
object.clone();//Does not compile since clone is protected.
a.clone();// allowed as this method is from int[]