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 ....

 

Receive Java & Developer job alerts in your Area

I have read and agree to the terms & conditions

 

Hashtable Iterator example

Bipartite Graph

With this example we are going to demonstrate how to obtain a Hashtable Iterator, that is an iterator of the key value pairs of the Hashtable. In short, to obtain an iterator of the Hashtable’s entries you should: Create a new Hashtable. Populate the hashtable with elements, using put(K key, V value) API method of Hashtable. Invoke the entrySet() API ...

Read More »

Get size of Hashtable example

Bipartite Graph

This is an example of how to get the size of the Hashtable, that is the number of the key- value pairs that the Hashtable contains. Getting the size of the Hashtable implies that you should: Create a new Hashtable. Populate the hashtable with elements, using put(K key, V value) API method of Hashtable. Invoke the size() API method of ...

Read More »

Get Set view of Hashtable keys example

Bipartite Graph

In this example we shall show you how to get a Set view of Hashtable keys. To get a Set view of Hashtable keys one should perform the following steps: Create a new Hashtable. Populate the hashtable with elements, using put(K key, V value) API method of Hashtable. Invoke keySet() API method of Hashtable. The method returns a Set that ...

Read More »

Get Collection view of Hashtable values example

Bipartite Graph

With this example we are going to demonstrate how to get a Collection view of the Hashtable values. In short, to get a Collection view of the Hashtable values you should: Create a new Hashtable. Populate the hashtable with elements, using put(K key, V value) API method of Hashtable. Invoke values() API method of Hashtable. It returns a Collection that ...

Read More »

Copy all elements of Hashmap to Hashtable example

Bipartite Graph

This is an example of how to copy all elements of a HashMap to a Hashtable. Coping HashMap elements to a Hashtable implies that you should: Create a new HashMap. Populate the hashmap with elements, using put(K key, V value) API method of HashMap. Create a new Hashtable. Populate the hashtable with elements, using put(K key, V value) API method ...

Read More »

Check value existence in Hashtable example

Bipartite Graph

In this example we shall show you how to check a value existence in a Hashtable. The Hashtable API provides methods for such operations. To check if a value exists in a Hashtable one should perform the following steps: Create a new Hashtable. Populate the hashtable with elements, using put(K key, V value) API method of Hashtable. Invoke containsValue(Object value) ...

Read More »

Check key existence in Hashtable example

Bipartite Graph

With this example we are going to demonstrate how to check a key existence in a Hashtable. In short, to check if a key exists in a Hashtable you should: Create a new Hashtable. Populate the hashtable with elements, using put(K key, V value) API method of Hashtable. Invoke the containsKey(Object key) API method of Hashtable, with a key as ...

Read More »

Vector Enumeration example

Bipartite Graph

This is an example of how to obtain a Vector Enumeration in Java. Obtaining a Vector Enumeration implies that you should: Create a new Vector. Populate the vector with elements, with add(E e) API method of Vector. Invoke elements() API method of Vector to get an Enumeration of the Vector’s elements. Enumerate through the elements of an Enumeration, with hasMoreElements(), ...

Read More »

Sort Vector example using Collections sort

Bipartite Graph

In this example we shall show you how to sort the elements of a Vector, using the Collections API, and in particular the sort(List list) API method. To sort the elements of a Vector one should perform the following steps: Create a new Vector. Populate the vector with elements, with add(E e) API method of Vector. Invoke the sort(List list) ...

Read More »

Set Vector size example

Bipartite Graph

With this example we are going to demonstrate how to set the Vector size, that is setting a greater or less size than the current size of the Vector. In short, to set the Vector size you should: Create a new Vector. Populate the vector with elements, with add(E e) API method of Vector. Invoke the setSize(int newSize) API method ...

Read More »