Map - getOrDefault(), putIfAbsent() in Java
Map - getOrDefault(key, Default-value) If the key is already mapped with a specified value, return the value, or return the default value if no value is associated with any key. 특정 key가 특정 value와 map 되어있다면 해당 value를 리턴하고 map이 안되어 있을 경우 default value를 리턴한다. Example code import java.util.*; public class Main { public static void main(String[] args) { String[] fruit = {"apple", "banana", "apple", "..
JAVA
2019. 7. 23. 06:12
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- math.max
- hackerrank
- C++
- hackerrank solution
- math.abs
- Javascript Algorithm
- HashMap
- easy algorithm
- algorithm
- 프로그래머스 알고리즘
- substring()
- 알고리즘
- Object type casting
- 프로그래머스 알고리즘문제
- rest parameter
- ... in Javascript
- javascript
- hackerrank javascript solution
- hackerrank javascript
- easy javascript algorithm
- HackerRank Algorithm
- string class in java
- compareTo()
- code refactoring
- repeat()
- 프로그래머스
- equals()
- java
- Collection Framework
- spring boot application
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함