IntVectorExampleII - //add 82 at the end...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.util.Vector; i public class IntVectorExampleII { public static void main(String[] arg) { Vector<Integer> intList = new Vector<Integer>(20); Integer num; //add numbers in intList for (int i = 0; i < 10; i++) { num = i + 5; intList.insertElementAt(num, i); } intList.addElement(82);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: //add 82 at the end System.out.println("intList: " + intList); //The following foreach loop outputs the numbers in //intList after multiplying each number with 2 for (int x : intList) System.out.print( 2 * x + " "); System.out.println(); } }...
View Full Document

This note was uploaded on 06/17/2011 for the course COMP 2301 taught by Professor Staff during the Spring '10 term at Kennesaw.

Ask a homework question - tutors are online