9:21 am - Thursday February 23, 2017

Author Archives: Mathan Lal

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

Vector Example Program for addAll(Collection c)

/** @author:candidjava.com @description:Vector example program for addAll(Collection c) */ import java.util.Vector; public class AddAll { public static void main(String args[]) { // create two objects of the vector Vector<Integer>...

Vector Example Program for addAll(int index, Collection c)

/*Program Name: Vector Example Program for addAll(int index, Collection c)*/ /** *@Author: Candidjava.com *@Description:Vector Example Program for addAll(int index, Collection c) Method is used to Inserts all of the elements in the...

Stack Example Program for retainAll(Collection c)

/** @author:candidjava.com @description:Stack example program for retainAll(Collection C) */ import java.util.Stack; public class StackRetainAll { public static void main(String[] args) { Stack s1 = new Stack(); // creating...

Stack Example Program for removeAll(Collection c)

/** *Stack Example Program for removeAll(Collection c) * @author candidjava.com * @description:Removes from this list all of its elements that are contained in the specified collection. */ import java.util.*; public class Line1...

Stack Example Program for containsAll(collection)

//Stack Example Program for containsAll(Collection c) /** * @author   candidjava.com * @Returns true if this list contains all of the elements of the specified collection. */ import java.util.*; public class Stac { public...

Stack Example Program for clone()

/** *@author:candidjava.com *@description:Stack example program for clone() */ import java.util.Stack; public class StackClone { public static void main(String[] args) { Stack s1 = new Stack(); // creating first stack for...

Stack Example Program for capacity()

/** *Stack Example Program for capacity() * @author   candidjava.com * @description:  Returns the capacity of the stack. */ import java.util.*; public class Stackcapacity { public static void main(String[] args) { Stack a =...

Stack Example Program for addAll(Collection c)

// Stack Example Program for addAll(Collection c) /** * @author   candidjava.com * @description:Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's...

Java Example Program for given character vowel or not

/** *@author:Sureshbabu *@description:java example program for given charcter is vowel or not */ import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.IOException; public class Vowel { public static...

Java Example Program to Swap number using bitwise operator

/** * * @author:canditjava.com * @description:java example program for Swap number using bitwise operator */ public class Swap { public static void main(String args[]) { int a = 89, b = 90; System.out.println("Before swapping:"); System.out.println("A="...

Java Example Program to find height Of Cone

/** @author :candidjava.com @description : this returns a value of height of cone representing math class. */ import java.lang.Math; public class HeightofCone { int r, h; void heightcone(int r, int h) { double s; s = Math.sqrt(Math.pow(r,...

propertiesExample Program for setProperty(string key,string value)

/** @author:candidjava.com @description:PropertiesExample Program for setProperty(String key,String value) */ import java.util.Properties; public class SetProperty { public static void main(String args[]) { Properties prop = new...

Vector Example Program for addElement(E obj)

/** *@author: candidjava.com *@description: Vector Example Program for addElement(E obj) */ import java.util.Properties; import java.util.Vector; import java.util.Enumeration; public class AddElement { public static void main(String[]...