We have seen examples of Throw and Throws in some of our previous posts. Throw and Throws keyword are used in different scenarios while doing exception handling. In this post we see some basic diff
Difference Between HashSet LinkedHashSet and TreeSet
HashSet, LinkedHashSet and TreeSet are all implementations of the Set interface.In this post lets see Difference Between HashSet LinkedHashSet and TreeSet. 1. Implementation All these 3 implement t
TreeSet Example in Java
TreeSet is a NavigableSet implementation based on a TreeMap. Sorting in the TreeSet makes it different from the HashSet. In TreeSet the elements are sorted ascending using their nartural sorting or
LinkedHashSet Example in Java
LinkedHashSet extends the HashSet and is the implementation of Hash Table and Linked List. LinkedHashSet maintains a doubly-linked list through all of its elements. This helps in maintaining the in
Merging Cells in Excel Using POI
Merging Cells in Excel using POI can be done using the XSSFSheet.addMergedRegion(CellRangeAddress region) method. CellRangeAddress is the range of the rows and columns that need to be selected. In our case to be m
User Defined Exceptions in Java
While working on an application, you may come across some scenarios where you feel like the Exceptions defined in the java platform are not enough to represent the error/issue you want to tell the
Sorting TreeMap Using Comparator
TreeMap are sorted naturally using their Keys. If you have your objects as keys then Sorting TreeMap using Comparator is a good way to decide the map order. Lets see an example on how to use Compar
WeakHashMap example in Java
WeakHashMap is a HashTable based implementation of the Map Interface. The keys of the WeakHashMap have weak reference and so an entry in a WeakHashMap will automatically be removed when its key is
LinkedHashMap example in Java
LinkedHashMap is part of the java.util package and it extends the HashMap, so it has all the properties of HashMap. LinkedHashMap maintains the order of insertion of the elements, hence when we ite
TreeMap example in Java
TreeMap is a part of the java.util package and implements the Map interface. TreeMap stores the Key-Value pairs in a sorted order of the Keys. TreeMap is a Red-Black tree based NavigableMap impleme