scg/ch08/PrintAnArrayList

From FANG

Jump to: navigation, search

01 package scg.ch08;
02 
03 import fang2.core.Game;
04 
05 import java.util.ArrayList;
06 
07 /**
08  * Demonstrate how an ArrayList prints using System.out.println.
09  */
10 public class PrintAnArrayList
11   extends Game {
12   /**
13    ArrayList of Integer (we will put in some numbers and do things
14    * with them)
15    */
16   private ArrayList<Integer> theTable;
17 
18   /**
19    * Create the ArrayList; print out some information about it
20    */
21   @Override
22   public void setup() {
23     System.out.println("theTable = " + theTable);
24     theTable = new ArrayList<Integer>();
25     System.out.println("theTable = " + theTable);
26     System.out.println("theTable.size() = " + theTable.size());
27   }
28 }
29 
30 //Uploaded on Mon Mar 29 21:39:15 EDT 2010


Download/View scg/ch08/PrintAnArrayList.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