clone (1) 썸네일형 리스트형 데이터 복제 clone() 메소드 // Cloneable 인터페이스를 구현한 클래스의 인스턴스만 clone()을 통한 복제가 가능함class Point implements Cloneable{int x;int y;Point(int x, int y){this.x = x;this.y = y;}@Overridepublic String toString() {return "Point [x=" + x + ", y=" + y + "]";}public Object clone(){Object obj = null;try{obj = super.clone();}catch(CloneNotSupportedException e) {}return obj;}} public class CloneEx1 {public static void main(String args[]).. 이전 1 다음