GK Leo,
To create an empty array you use the following format:
datatype arrayname [];
or
datatype [] arrayname:
Example:
Customer carray [];
or
Customer [] carray;
However, this line only creates an empty array, it does not specify the initial size or values of the array. To create an array and give it initial values you would use the following format:
datatype arrayname [] = new datatype {List element values here seperated by commas};
or
datatype [] arrayname = new datatype {List element values here seperated by commas};
Example:
String CustomerAddress = new String {"Bob", "Joe", "Sally", "Peter"};
Also the arguments you supply seem to be header values to columns in a table. An array would typically store the values that would appear in the cells of a table, not the names of the columns or rows in a table. In my above example I have created an array that contains string values representing customer names. (Arguments that supply the initial values of an array should be encased in squiggly brackets, not square brackets.)
You can store an array of Customer objects that contains variables containg the customer information, but you might consider a collection instead.
You can check out these tutorials for more info on arrays and collections:
Collections Tutorial:
http://java.sun.com/docs/books/tutorial/collections/ Array Tutorial:
http://java.sun.com/docs/books/tutorial/java/data/arrays.html Landon
[ May 14, 2004: Message edited by: Landon Blake ]
[ May 14, 2004: Message edited by: Landon Blake ]