3:53 pm - Friday March 25, 0833

Tag Archives: Java Example

Hashtable Example program for keys()

/** Author :candidjava.com Description: Returns an enumeration of the keys in this hashtable. */ import java.util.*; import java.util.Hashtable; import java.io.IOException; public class HashtableKeysExample { public static void...

Hashtable Example program for isEmpty()

/** Author :candidjava.com Description: Tests if this hashtable maps no keys to values. */ import java.util.*; import java.util.Hashtable; import java.io.IOException; public class HashtableIsEmptyExample { public static void main(String...

Hashtable Example program for hashCode()

/** Author :candidjava.com Description: Returns the hash code value for this Map as per the definition in the Map interface.. */ import java.util.*; import java.util.Hashtable; import java.io.IOException; public class HashtableHashcodeExample...

Hashtable Example program for get(Object key)

/** Author :candidjava.com Description: Returns the value to which the specified key is mapped in this hashtable. */ import java.util.*; import java.util.Hashtable; import java.io.IOException; public class HashtableGetExample { public...

LinkedList Example Program for listIterator(int index)

/** Author :candidjava.com Description: Returns a list-iterator of the elements in this list (in proper sequence), starting at the specified position in the list. */ import java.io.IOException; import java.util.*; public class LinkedListListIterator...

LinkedList Example Program for lastIndexOf(Object o)

/** Author :candidjava.com Description: Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element. */ import java.io.IOException; import java.util.*; public class...

LinkedList Example Program for contains(Object o)

/** Author :candidjava.com Description: It will return the hashcode value of the object which we creates. */ import java.io.IOException; import java.util.*; public class LinkedListContainExample { public static void main(String...

LinkedList Example Program for clear()

/** Author :candidjava.com Description: To calculate the current capacity of the string by using capacity() method it returns the current capacity of the String */ import java.io.IOException; import java.util.*; import java.io.IOException; public...

LinkedList Example Program for addLast(E e)

/** Author :candidjava.com Description: Appends the specified element to the end of this list. */ import java.io.IOException; import java.util.*; import java.io.IOException; public class LinkedlistAddLast { public static void main(String...

LinkedList Example Program for addFirst(E e)

/** Author :candidjava.com Description: To Inserts the specified element at the beginning of this list. */ import java.io.IOException; import java.util.*; import java.io.IOException; public class LinkedListAddFirst { public static...

LinkedList Example Program for add(int index, E element)

/** Author :candidjava.com Description: Inserts the specified element at the specified position in this list. */ import java.io.IOException; import java.util.*; import java.io.IOException; public class LinkedlistAddExample2 { public...

LinkedList Example Program for add(E e)

/** @Author :candidjava.com @Description: To appends the specified element to the end of this list. */ import java.io.IOException; import java.util.*; public class LinkedlistAddExample { public static void main(String args[]) { boolean...

Vector Example Program for setSize(int newSize)

/** @author: candidjava @description: setSize(int newSize) is used to Sets the size of this vector. */ import java.util.*; public class DeeSetSizeVector { public static void main(String[] args) { Vector v = new Vector();// create...

Vector Example Program for setElementAt(E obj,int index)

/** @author: candidjava @description: setElementAt(E obj,int index) is used to Sets the component at the specified index of this vector to be the specified object. */ import java.util.*; public class DeeSetElementsVector { public...

Vector Example Program for set(int index,E element)

/** @author: candidjava @description: set(int index,E element) is used to Replaces the element at the specified position in this Vector with the specified element. */ import java.util.*; public class DeeSetVector { public static...

Vector Example Program for retainAll(Collection c)

/** @author: candidjava @description: retainAll(Collection c)is used to Retains only the elements in this Vector that are contained in the specified Collection. */ import java.util.*; public class DeeRetainAllVector { public static...

Vector Example Program for removeRange(int fromIndex,int toIndex)

/** @author: candidjava @description: removeRange(int fromIndex,int toIndex) is used to Removes from this List all of the elements whose index is between fromIndex, inclusive and toIndex, exclusive. */ import java.util.*; public class...

Vector Example Program for removeElementAt(int index)

/** @author: candidjava @description: removeElementAt(int index) is used to Deletes the component at the specified index and return new elements */ import java.util.*; public class DeeRemoveElementAtVector { public static void main(String[]...

Vector Example Program for removeElement(Object obj)

/** @author: candidjava @description: removeElement(Object obj) is used to Removes the first (lowest-indexed) occurrence of the argument from this vector.if the elements is removed means return true otherwise return false */ import java.util.*; public...

Vector Example Program for removeAllElements()

/** @author: candidjava @description: removeAllElements() is used to Removes all components from this vector and sets its size to zero. */ import java.util.*; public class DeeVectorRemoveAllElements { public static void main(String[]...