오브젝트 클래스의 메소드중

protected Object clone()이라는 메소드가있는데


java.lang인 object가 다른패키지이지만 protected이고

모든클래스가 object를 상속하고있으니, 당연히 clone()도 사용이 가능한게아닌가?


쉽게말하자면 다른패키지인 object를 상속하고있음에도 왜 직접 clone()메소드 사용이 안되는거임?


클론을 사용하려는 클래스로 cloneable을 구현하긴함


package org.opentutorials.javatutorials.progenitor;
class Student implements Cloneable{
String name;
Student(String name){
this.name = name;
}
protected Object clone() throws CloneNotSupportedException{ ->오버라이딩을 왜함? protected면 상속된 student객체로 사용가능아닌가?
return super.clone(); ->이렇게하는이유가머냐?
}
}