3:11 pm - Sunday November 25, 8553

Tag Archives: ArrayList

Vector Example Program for toArray(T[] a)

/*Program Name: Vector Example Program for toArray(T[] a)*/ /** *@Author: Candidjava.com *@Description:Vector Example Program for toArray(T[] a) Method is used to Returns an array containing all of the elements in this Vector in the...

Vector Example Program for toArray()

/***vector ex0ample program for toArray()***/ /** *@Author:CandidJava.com *@Description:convert vector collection to Array */ import java.util.Vector; public class VectorToArray { public static void main(String args[]) { Vector...

Vector Example Program for size()

// Vector Example Program for size() /** @author: candidjava.com @description: This program gives the number of elements in the Vector. */ import java.util.*; public class Size { public static void main(String[] args) { Vector...

Vector Example Program for copyInto(Object[] anArray)

// Vector Example Program for copyInto(Object[] anArray) /** @author: candidjava.com @description: This program copies the content of the vector into the Array */ import java.util.*; public class CopyInto { public static void...

Vector Example Program for containsAll(Collection c)

// Vector Example Program for containsAll(Collection c) /** @author: candidjava.com @description: This program returns "true" if the vector contains all of the elements in the specified collection otherwise returns false. */ import...

Vector Example Program for contains(Object o)

// Vector Example Program for contains(Object o) /** @author: candidjava.com @description: This program returns "true" if the vector contains the specified element otherwise returns false. */ import java.util.*; public...

Vector Example Program for clone()

// Vector Example Program for clone() /** @author: candidjava.com @description: The Program uses the clone() method to get a copy of an existing vector. */ import java.util.*; class Clone { public static void main(String[] args)...

Vector Example Program for get(int index)

// Vector Example Program for get(int index) /** @author: candidjava.com @description: This program returns the element at the specified index in the Vector. */ import java.util.*; public class Get { public static void main(String[]...

Vector Example Program for indexOf(Object o,int index)

/*Program Name: Vector Example Program for indexOf(Object o, int index)    */ /** *@Author: Candidjava.com *@Description: Vector Example Program for indexOf(Object o, int index) Method is used to return the index of the last occurrence...

ArrayList Example Program for trimTosize()

/** *@Author: Candid.com *@Description: ArrayList Example Program For trimToSize and Contains */ import java.util.*; public class ArrLst { public static void main(String[] args) { ArrayList arl = new ArrayList(); arl.add("A"); arl.add("X"); arl.add("K"); arl.add("H"); arl.add("O"); Iterator...

ArrayList Example Program for clone()

/** @Author:candidjava.com @Description:cloning the arraylist */ import java.util.*; public class DeeCloning { public static void main(String args[]) { ArrayList<String> al = new ArrayList<String>(); // creating...

ArrayList Example Program for ensureCapacity(int minCapacity)

/** @Author:candidjava.com @Description:Increasing the array list capacity */ import java.util.*; public class Capacity { public static void main(String args[]) { ArrayList<Integer> al = new ArrayList<Integer>(); //...

ArrayList Example program for subList(int fromIndex, int toIndex)

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of subList(int fromIndex, int toIndex). It is used to get an element in specified from and toindex of arrayList */ import java.io.*; import java.util.*; public...

ArrayList Example program for listIterator(int index)

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of listIterator(int index) . It is used to return next and previous element of the list in proper sequence from given index position */ import java.io.*; import...

ArrayList Example program for listIterator()

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of listIterator(). It is used to return next and previous element of the list in proper sequence */ import java.io.*; import java.util.*; public...

ArrayList Example Program for iterator()

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of iterator() . It is used to return next element of the list in proper sequence */ import java.io.*; import java.util.*; public class ArrayListIterator { public...

ArrayList Example Program for add(E e)

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of boolean add(E e).It is used to check whether given element append in end of the List or not */ import java.io.*; import java.util.*; public ...

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

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of void add(E e).It is used to add an element in specified index of arrayList */ import java.io.*; import java.util.*; public class ArrayListAppends { public...

ArrayList Example Program for clear()

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of void clear().It is used to remove all elements in list */ import java.io.*; import java.util.*; public class ArrayListClear { public static...

ArrayList Example Program for indexOf(Object o)

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of int indexOf(Object o).It is used get index value for specfied element */ import java.io.*; import java.util.*; public class ArrayListIndexOf { public...