1. Private 배열에 Public 데이터 할당
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
private List<String> noTest = null;
public void setNoSessionUrls(List<String> aTest){
this.noTest = aTest;
}
아래의 형태로 변경
public void setNoSessionUrls(List<String> aTest){
// Private배열에 Public데이터 할당
// this.noTest = aTest;
this.noTest = new ArrayList<String>();
this.noTest .addAll(aTest);
}
| cs |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
private char[] aTest; String[] 등도
public Test(char[] bTest) {
this.aTest= bTest;
}
아래로 변경
public Test(char[] bTest) {
// Private배열에 Public데이터 할당
// this.aTest= bTest;
this.aTest= new char[bTest.length];
for(int i=0; i<bTest.length; i++){
this.aTest[i] = bTest[i];
}
}
| cs |
댓글 없음:
댓글 쓰기