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 | 31 |
Tags
- Data Structure
- 구현
- implement
- 자바
- simulation
- database
- Class
- Binary Search
- Method
- dynamic programming
- Stack
- Matrix
- 코테
- bit manipulation
- Binary Tree
- sorting
- java
- geometry
- 파이썬
- Counting
- array
- two pointers
- Number Theory
- hash table
- Tree
- Math
- 코딩테스트
- string
- SQL
- greedy
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