Blog Archives

04: Convert Lists to Maps and Maps to Lists with Java 8 power

Why convert from a list to a map? Maps allow you to store and access data by a “KEY”. Lists only allow you to access data by either index or...

Convert Arrays to Lists and lists to array with real life example(s)

1. Why do you want to convert arrays to lists? 1. Arrays don’t play well with generics. 2. Arrays are of fixed size, … Read more ›...

Convert Java Date/Time to String & String back to Date/Time

#1. Why convert a Date to String & a String back to Date

(a) Convert a String input from say a file date, so that you can perform operations like

1) Adding 5 days to the date.

Read more ›

Converting a BST Tree to a List in Java

This is the reverse of Converting an Array/List to BST in Java. It is a very common task to convert a collection type A to B as a developer. …...

Converting an Array/List to BST in Java

Q. What is a BST? A. BST stands for Binary Search Tree, sometimes called ordered or sorted binary trees. This is a type of data structures that store “items” …...

Converting String to Amount and Amount to String

#1. Does Java have a “Money” class? No. This will change in Java 9 with the “Money API”. JSR 354 defines a new Java API for working with Money and...

800+ Java Interview Q&As