1: private String[] colors; 2: // 메소드를 private으로 하거나, 복제본 반환, 수정하는 public 메소드를 별도로 만든다. 3: public void onCreate(Bundle savedInstanceState) { 4: super.onCreate(savedInstanceState); 5: String[] newColors = getColors(); 6: } 7: public String[] getColors() { 8: String[] ret = null; 9: if ( this.colors != null ) { 10: ret = new String[colors.length]; 11: for (int i = 0; i < colors.length; i++) { ret[i] = this.colors[i]; } 12: } 13: return ret; 14: }