Tag Archives: learn
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 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 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 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 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="...