티스토리 뷰
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
- ... in Javascript
- hackerrank solution
- algorithm
- code refactoring
- equals()
- easy javascript algorithm
- javascript
- 프로그래머스 알고리즘문제
- Object type casting
- compareTo()
- java
- string class in java
- HackerRank Algorithm
- substring()
- repeat()
- hackerrank javascript
- HashMap
- rest parameter
- 프로그래머스 알고리즘
- Collection Framework
- 알고리즘
- C++
- 프로그래머스
- hackerrank javascript solution
- spring boot application
- Javascript Algorithm
- math.max
- hackerrank
- math.abs
- easy algorithm
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함