티스토리 뷰
List<Integer> list = new ArrayList<Integer>();
This declaration enables to use methods including List interface. It allows to to modify your code to another, such as LinkedList or any other List so that, this declaration is the most used one.
ArrayList<Integer> list = new ArrayList<Integer>();
Whereas, if you use this second declaration, It stores ArrayList methods only. You have to change your code whenever you modify your ArrayList to other types of List.
'JAVA' 카테고리의 다른 글
Reference Data Type in Java (0) | 2019.02.20 |
---|---|
Anonymous class in Java (0) | 2019.02.20 |
Upcasting (Object type casting) in java (0) | 2019.01.30 |
String class in Java (0) | 2019.01.20 |
Collection framework - ArrayList (0) | 2019.01.17 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- substring()
- hackerrank
- compareTo()
- repeat()
- equals()
- hackerrank javascript solution
- string class in java
- spring boot application
- C++
- HashMap
- 프로그래머스 알고리즘문제
- Object type casting
- javascript
- 알고리즘
- hackerrank solution
- hackerrank javascript
- code refactoring
- math.abs
- Collection Framework
- math.max
- rest parameter
- HackerRank Algorithm
- java
- algorithm
- easy algorithm
- 프로그래머스
- easy javascript algorithm
- Javascript Algorithm
- ... in Javascript
- 프로그래머스 알고리즘
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함