11:03 pm - Thursday February 23, 2017

Tag Archives: Vector

Vector Example Program for toString()

@author:candidjava.com @description:Vector Example Program for toString() */ import java.util.Vector; public class ToString { public static void main(String args[]) { Vector<Integer>vc=new Vector<Integer>(); vc.add(11); vc.add(22); vc.add(33); vc.add(44); System.out.println(vc); //convert...

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 list(PrintWriter out)

/** *@author: candidjava *@description: PropertiesExample Program for list(PrintWriter out) **/ import java.io.PrintWriter; import java.util.Properties; public class PropertiesDemo { public static void main(String[] args) { Properties...

Vector Example Program for clear()

/*vector example program for clear()*/ /** *@Author:CandidJava.com *@Description:Vector Example Program for clear() */ import java.util.Vector; public class Clear { public static void main(String args[]) { Vector vc=new Vector();//create...

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

Vector Example Program for removeAll(Collection c)

/** @author: candidjava @description: removeAll(Collection c) is used to Removes from this Vector all of its elements that are contained in the specified Collection. */ import java.util.*; public class DeeVectorRemoveAll { public static...