View Single Post
Old 02-08-2009, 10:57 PM   PM User | #6
Mutley
New to the CF scene

 
Join Date: Feb 2009
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Mutley is an unknown quantity at this point
simple arraylist usage

Code:
import java.util.ArrayList;
public class Name {
public static ArrayList<String> names  ;

public static void main (String args[]){
	names = new ArrayList<String>(20);
	add("alex");
	add("loves");
	add("your");
	add("pepsi");
	printall();
}
public static void add (String n){
	names.add(n);
}
public static void printall(){
	for(String c:names){
		System.out.println(c);
	}
}
}
sorry for the random text
Mutley is offline   Reply With Quote