Friday, May 13, 2016

vector in java

package com.home;

import java.util.Iterator;
import java.util.Vector;

public class VectorDemo {

public static void main(String[] args) {

Vector obj = new Vector();

obj.add(12);
obj.add("ram");
obj.add(1);



//System.out.println(obj);

/* Iterator it = obj.iterator();

while(it.hasNext()){
System.out.println(it.next());
}
*/

for(int i=0;i<obj.size();i++){

System.out.println(obj.get(i));
}

}

}


The Output of the Following Program is:
12
ram
1

Related Posts:

  • Stack in java: Stack in java: package javaapplication27; import java.util.Stack; public class TestStack {         public static void main(Str… Read More
  • Overloading Constructor: Overloading Constructor: package overloadingconstrucror; public class Box {     double width;     double height;     d… Read More
  • String Length in java String Length in java: The length of the String is the actual number of character that contains in it.To get this value,call the length() method as … Read More
  • Increment And Decrement Operator Increment and Decrement Operator: package javaapplication16; public class IncrementAndDecrementOPeratorDemo {     public static void mai… Read More
  • Java break statement: Java break statement: package javaapplication27; public class BreakDemo {     public static void main(String[] args) {     &nbs… Read More

1 comment:

  1. Las Vegas - Casino & Resort Fee - JetBlue
    The hotel charges a stay at 3131 Las Vegas Blvd. 안양 출장샵 South, Las Vegas NV 89109. 논산 출장마사지 This hotel is 광주광역 출장샵 free, and the 충청북도 출장안마 following amenities are available to 천안 출장안마

    ReplyDelete