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