public class CastAryListToArray {
public static void main(String arg[]){
//How to cast ArrayList to Array
//The following code will store arraylist value into array:
ArrayList al = new ArrayList();
al.add("a");
al.add("b");
al.add("c");
String XAxisValue[] = new String[al.size()];
al.toArray(XAxisValue);
for(int i=0;i<XAxisValue.length;i++){
System.out.println("XAxisValue["+i+"] = " + XAxisValue[i]);
}
}
}
Saturday, July 26, 2008
Java: Cast ArrayList to Array
import java.util.ArrayList;
Subscribe to:
Post Comments (Atom)
Since 26 July 2008:
No comments:
Post a Comment