Get first and last entries in a Map or HashMap in Java [4 ways] | Java Hungry
In this post, I will be sharing how to get first and last entries in a Map or HashMap in Java with examples. 1. Using Stream API
2. Using ArrayList...
1 Year Ago
Get the first and last elements of the Set or HashSet in Java [2 ways] | Java Hungry
In this post, I will be sharing how to get the first and last elements of the Set or HashSet in Java.
1. Using Stream API
2. Using iterator...
1 Year Ago
Format LocalDate to String in Java with Examples | Java Hungry
In this post, I will be sharing how to format LocalDate to String in Java with examples.
1. Using toString() method
2. Using DateTimeFormatter with ...
1 Year Ago
Convert String to LocalTime in Java (with/without nanoOfSeconds) | Java Hungry
In this post, I will be sharing how to convert String to LocalTime in Java (with/without nanoOfSeconds).
1. Using LocalTime.parse() method
2. Using...
1 Year Ago
Format BigDecimal as String with max 2 decimal digits | Java Hungry
In this post, I will be sharing how to format BigDecimal as String with max 2 decimal digits. There are two ways:
1. Exactly 2 decimal digits
2. Max 2...
1 Year Ago
Convert BigDecimal to String in Java [2 ways] | Java Hungry
In this post, I will be sharing how to convert BigDecimal to String in Java with examples.
1. Using String.valueOf() method [Recommended]
2. Using to ...
1 Year Ago