|
Quote:
|
|
possible to have an array of arrays in Java
|
Yes it definitely is. The problem is: what types are the elements in the arrays. If they are all the same, no problem. Muliti dimensional arrays in java are arrays of arrays.
int[][] anArray = new int[10][]; // define a 2 dim array
anArray[0] = new int[5]; // define an array as the first element
If the elements are different types, then using the type Object will allow you to save anything, but this is NOT a recommended way to code.
Object[][] someObjects = new Object[10][]; // 1st dim is 10, other dims sized as created
someObjects[0] = new String[5]; // first array is an array of Strings
someObjects[1] = new Integer[20]; // 2nd is Integers
someObjects[0][2] = "third string"; // put something in array
someObjects[1][1] = new Integer(33); // ditto
It be better to have a class for the server that defines a container(could be an array) that holds its children. The servers would be stored in their own container(could be an array).