Written by veera|November 6, 2013|Comments Off on Remove Capacity of a vector void trimToSize()

BACK
The trimToSize() method is used to trim the capacity of this vector to be the vector’s current size. If the capacity of this vector is larger than its current size, then the capacity is changed...

Written by veera|November 6, 2013|Comments Off on Replace an element present in a Vector E set(int index, E element)

BACK
The public E set(int index, E element) method Replaces the element at the specified position in this Vector with the specified element.
Example program
import java.util.Vector;
public class VectorSet...

Written by veera|November 6, 2013|Comments Off on Verify LinkedHashMap is Empty boolean isEmpty()

BACK
The method public boolean isEmpty() checks whether the map is empty or not. If the map is empty it returns true,Otherwise it returns false.
Example Program
import java.util.LinkedHashMap;
public...

BACK
The method public V put(K key,V value ) assigns the value with the specified key in the map. Also if a map previously contains a value for the key, the old value is replaced.
Example Program
import java.util.Iterator;
import...