Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 28 |
29 | 30 |
Tags
- java
- geometry
- 자바
- dynamic programming
- 코테
- Class
- Math
- SQL
- database
- sorting
- 코딩테스트
- bit manipulation
- two pointers
- Data Structure
- hash table
- Method
- Binary Search
- Number Theory
- Stack
- implement
- 구현
- Binary Tree
- string
- Matrix
- Tree
- array
- simulation
- greedy
- 파이썬
- Counting
Archives
- Today
- Total
목록CHECK (1)
코린이의 소소한 공부노트
지네릭스
// 지네릭스를 사용하지 않던 시절.. // ArrayList에는 Object[]가 있음 ArrayList list = new ArrayList(); // 아무 객체나 다 저장 가능 list.add(10); list.add(20); list.add(“30”); // ?? System.out.println(list); // [10, 20, 30] Integer i = list.get(2); // 에러. 2번째 요소는 String이므로 Integer에 저장 불가 Integer i = (Integer)list.get(2); // 컴파일 통과. get()의 반환타입이 Object이므로 형변환 가능. // 하지만 실행단계에서 ClassCastException 발생 [지네릭스] 1. 컴파일시 타입을 체크해주는 기능..
Java
2022. 11. 9. 01:33