Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!

 

1. JPA Mini Book

2. JVM Troubleshooting Guide

3. JUnit Tutorial for Unit Testing

4. Java Annotations Tutorial

5. Java Interview Questions

 

and many more ....

 

 

Convert Object Array to List example

With this example we are going to demonstrate how to convert an Object array to a List. We are using a String array in the example. In short, to convert an String array to a List you should: Create a String array with elements. Invoke asList(Object[] objArray) API method of Arrays, with the list as parameter. It returns a fixed ...

Read More »

Remove mapping from TreeMap example

This is an example of how to remove mapping from a TreeMap, that is removing a key value pair from a TreeMap. Removing mapping from a TreeMap implies that you should: Create a new TreeMap. Populate the map with elements, with put(K key, V value) API method of TreeMap. Invoke remove(Object o) API method of TreeMap with a key as ...

Read More »

Remove all mappings from TreeMap example

In this example we shall show you how to remove all mappings from a TreeMap, that is removing all key value pairs from the TreeMap. To clear a TreeMap one should perform the following steps: Create a new TreeMap. Populate the map with elements, with put(K key, V value) API method of TreeMap. Invoke clear() API method of TreeMap. The ...

Read More »

TreeMap Iterator example

With this example we are going to demonstrate how to obtain a TreeMap Iterator, that is an iterator over the key value pairs of the TreeMap. The TreeMap API provides methods to get an Iterator. In short, to obtain a TreeMap Iterator you should: Create a new TreeMap. Populate the map with elements, with put(K key, V value) API method ...

Read More »

Obtain tail map from TreeMap example

This is an example of how to obtain a tail map from a TreeMap. The TreeMap API provides methods for this operation. Obtaining a tail map from a TreeMap implies that you should: Create a new TreeMap. Populate the map with elements, with put(K key, V value) API method of TreeMap. Invoke tailMap(Object fromKey) API method of TreeMap. It returns ...

Read More »

Obtain sub Map from TreeMap example

In this example we shall show you how to obtain a sub Map from a TreeMap. The TreeMap API provides methods for this operation. To obtain a sub Map from a TreeMap one should perform the following steps: Create a new TreeMap. Populate the map with elements, with put(K key, V value) API method of TreeMap. Invoke subMap(Object fromKey, Object ...

Read More »

Get size of TreeMap example

With this example we are going to demonstrate how to get the size of a TreeMap, that is the number of key value pairs that the TreeMap contains. In short, to get the size of a TreeMap you should: Create a new TreeMap. Populate the map with elements, with put(K key, V value) API method of TreeMap. Invoke size() API ...

Read More »

Get Set view of TreeMap keys example

This is an example of how to get a Set view of the TreeMap keys. Getting a Set view of the TreeMap keys implies that you should: Create a new TreeMap. Populate the map with elements, with put(K key, V value) API method of TreeMap. Invoke keySet() API method of TreeMap. The method returns a Set of all the keys ...

Read More »

Obtain lowest and highest keys from TreeMap example

In this example we shall show you how to obtain the lowest and highest keys from a TreeMap. The TreeMap API provides methods for these operations. To obtain the lowest and highest keys from a TreeMap one should perform the following steps: Create a new TreeMap. Populate the map with elements, with put(K key, V value) API method of TreeMap. ...

Read More »

Obtain head Map from TreeMap example

With this example we are going to demonstrate how to obtain a head Map from a TreeMap. In short, to obtain a head Map from a TreeMap you should: Create a new TreeMap. Populate the map with elements, with put(K key, V value) API method of TreeMap. Invoke headMap(K toKey) API method of TreeMap, with a specified key as parameter. ...

Read More »