Hi friend,
I hope something below will help you to know about the List class:
Code:
java.awt.List
import java.util.ArrayList;
public class ToArrayDM
{
public static void main(String[] ankrgs) {
List list01 = new ArrayList();
list01.add("Blobbo");
list01.add("Cracked");
list01.add("Dumbo");
Object[] ol1 = list01.toArray();
System.out.println("Array of Object has length " + ol1.length);
String[] sl01 = (String[]) list01.toArray(new String[0]);
System.out.println("Array of String has length " + sl01.length);
}
}
Bookmarks