Object class is having clone method for creating exactly duplicate objects. This method works for every class but why can't I create copy of object of Object class? Which Java concepts behind such behavior ?
I tried two different cases but it doesn't work. It gives compile time error : The method clone() from the type Object is not visible
Object o = new Object();
Object o2 = o.clone();
Object o = new Test(); // Some Test class
Object o2 = o.clone();