GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — algorithm/algorithm-note at main · Gimini-3/algorithm Expand file tree/ Copy pathalgorithm-noteMore file actions 7 lines (6 loc) · 528 Bytes / Copy pathalgorithm-noteFile metadata and controls7 lines (6 loc) · 528 Bytes 1 2 3 4 5 6 7 //Vector를 int[]로 변환 Vector<Integer> vec=new Vector<Integer>(); int[] result=vec.stream().mapToInt(i->i).toArray(); Arrays.sort(result); //stream() 메소드는 Vector의 요소에 대한 스트림을 만들고, mapToInt(i -> i) 메소드는 각 요소를 int로 변환하며, 마지막으로 toArray() 메소드는 변환된 int들을 int[]로 모은다. //vec가 null이 아니고 모든 요소가 null이 아닌 Integer인 경우에만 작동한. 그렇지 않은 경우 NullPointerException이 발생할 수 있다. |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |