배열에서만 쓰길 원한다.

Effective Java

[아이템 13] clone 재정의는 주의해서 진행하라

clone은 객체를 복사한다. Cloneable 구현 예시 public class TestCloneDto implements Cloneable { private String name; private String email; public String toString () { return " name : " + name + " email : " + email; } public TestCloneDto(String name, String email) { this.name = name; this.email = email; } @Override protected TestCloneDto clone() throws CloneNotSupportedException { return (TestCloneDto) super.c..

girin_dev
'배열에서만 쓰길 원한다.' 태그의 글 목록