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
- laravel
- 이클립스
- larravel
- junit
- Linux
- input
- JSON
- html
- javascript
- error
- File
- 리눅스
- 정규식
- php
- NetBeans
- curl
- properties
- Android
- SeLinux
- 와일드카드
- Spring
- java
- ajax
- jquery
- 톰캣
- tomcat
- 안드로이드
- CentOS
- MySQL
- DB
Archives
- Today
- Total
합쭈기 programming
자바 와일드 카드 본문
매개변수의 다형성 위해 와일드 카드 '?' 를 사용 한다.
ArrayList<? extends Product> list
(인터페이스도 extends'를 사용)
pattern 1
public static void printAll(ArrayList<? extends Product> list){
for(Product p : list){
System.out.println(p);
}
}
pattern 2
public static <T extends Product> void printAll(ArrayList<T> list){
for(Product p : list){
System.out.println(p);
}
}
'Java > Spring' 카테고리의 다른 글
메모리 누수 확인 - TPTP (0) | 2015.05.19 |
---|---|
Excel 다운로드 (0) | 2015.05.18 |
xml에서 properties 설정 사용하기 (0) | 2015.05.11 |
JRebel - 재구동 없이 java & xml 변경 plugin (0) | 2015.05.11 |
소스상에서 properties 사용하기 (0) | 2015.05.07 |