scg/ch08/PrintAnArrayList4

From FANG

Jump to: navigation, search

01 package scg.ch08;
02 
03 import java.util.ArrayList;
04 
05 import fang2.core.Game;
06 
07 /** Demonstrate ArrayList.get(index). */
08 public class PrintAnArrayList4
09   extends Game {
10   /** Table of numbers. Filled and printed. */
11   private ArrayList<Integer> theTable;
12 
13   /**
14    * Create and fill theTable; print entries
15    */
16   @Override
17   public void setup() {
18     theTable = new ArrayList<Integer>();
19 
20     for (int = 0; i != 70; i = i + 7{
21       theTable.add(i);
22     }
23     
24     System.out.println("<after>");
25     for (int = 0; j != theTable.size()++j{
26       System.out.print(" " + theTable.get(j));
27     }
28     System.out.println();
29   }
30 }
31 
32 //Uploaded on Mon Mar 29 21:41:54 EDT 2010


Download/View scg/ch08/PrintAnArrayList4.java





Views
Personal tools
Add to 
del.icio.usAdd to 
diggAdd to 
FacebookAdd to 
favoritesAdd to 
GoogleAdd to 
MySpaceAdd to 
PrintAdd to 
SlashdotAdd to 
StumbleUponAdd to 
Twitter

Games
Games