I just had an idea to test something out and it worked:
String[][] arr = new String[4][4];
arr[2] = new String[5];
for(int i = 0; i < arr.length; i++)
{
System.out.println(arr[i].length);
}
The output obviously is:
4
4
5
4
So my questions are:
- Is this good or bad style of coding?
- What could this be good for?
- And most of all, is there a way to create such a construct in the declaration itself?
- Also... why is it even possible to do?