Blog Archives
Page 1 of 2
1 2

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 by looping through the whole list to find a value that you are interested in. … Read more ›...

Members Only Content
Log In Register Home


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, and if you want to add or insert more elements then a list serves that purpose. 3. … Read more ›...

Members Only Content
Log In Register Home


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.
2) Comparing a date like before,

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. More examples to practice: Converting from A to B There are 3 ways to traverse a tree to flatten it to...

Members Only Content
Log In Register Home


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” such as numbers, names etc in memory. A BST allows fast lookup, addition and removal of items, … Read more ›...

Members Only Content
Log In Register Home


Page 1 of 2
1 2

800+ Java Interview Q&As Menu

Top