Category Archives: Java

Chapter 29: LinkedHashMap

LinkedHashMap class is Hash table and Linked list implementation of the Map interface, with predictable iteration order. It inherits HashMap class and implements…
Continue reading

Chapter 28: Maps

The java.util.Map interface represents a mapping between keys and their values. A map cannot contain duplicate keys; and each key can map to…
Continue reading

Chapter 27: List vs Set

What are differences between List and Set collection at the top level and How to choose when to use List in java and…
Continue reading

Chapter 26: Sets

Section 26.1: Initialization A Set is a Collection that cannot contain duplicate elements. It models the mathematical set abstraction. Set have its implementation…
Continue reading

Chapter 25: Lists

A list is an ordered collection of values. In Java, lists are part of the Java Collections Framework. Lists implement the java.util.List interface,…
Continue reading

Chapter 24: Collections

The collections framework in java.util provides a number of generic classes for sets of data with functionality that can't be provided by regular…
Continue reading

Chapter 23: Arrays

Parameter                                                                            Details ArrayType Type of the array. This can be primitive (int, long, byte) or Objects (String, MyObject, etc). index               Index refers to the…
Continue reading

Chapter 22: Bit Manipulation

Section 22.1: Checking, setting, clearing, and toggling individual bits. Using long as bit mask Assuming we want to modify bit n of an…
Continue reading

Chapter 21: NumberFormat

Section 21.1: NumberFormat Different countries have different number formats and considering this we can have different formats using Locale of java. Using locale…
Continue reading

Chapter 18: LocalTime

Method                                                               Output LocalTime.of(13,  12,  11)                           13:12:11 LocalTime.MIDNIGHT                                        00:00 LocalTime.NOON                                                 12:00 LocalTime.now()                                                  Current time from system clock LocalTime.MAX                                                   The maximum supported local time 23:59:59.999999999 LocalTime.MIN                                                    The…
Continue reading