File tree Expand file tree Collapse file tree
src/effectivejava/chapter4/item20 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package effectivejava .chapter4 .item20 ;
22import java .util .*;
33
4- // Concrete implementation built atop skeletal implementation (Page 101 )
4+ // 코드 20-1 골격 구현을 사용해 완성한 구체 클래스 (133쪽 )
55public class IntArrays {
66 static List <Integer > intArrayAsList (int [] a ) {
77 Objects .requireNonNull (a );
88
9- // The diamond operator is only legal here in Java 9 and later
10- // If you're using an earlier release, specify <Integer>
9+ // 다이아몬드 연산자를 이렇게 사용하는 건 자바 9부터 가능하다.
10+ // 더 낮은 버전을 사용한다면 <Integer>로 수정하자.
1111 return new AbstractList <>() {
1212 @ Override public Integer get (int i ) {
13- return a [i ]; // Autoboxing (Item 6)
13+ return a [i ]; // 오토박싱(아이템 6)
1414 }
1515
1616 @ Override public Integer set (int i , Integer val ) {
1717 int oldVal = a [i ];
18- a [i ] = val ; // Auto-unboxing
19- return oldVal ; // Autoboxing
18+ a [i ] = val ; // 오토언박싱
19+ return oldVal ; // 오토박싱
2020 }
2121
2222 @ Override public int size () {
You can’t perform that action at this time.
0 commit comments