Consider this code:
class arraytest {
public static void main(String args[]){
int[] a = null , b[] =null;
b = a;
System.out.println( b );
}
}
the line
b=a;
is flagged by the compiler saying:
Incompatible types, found int[], required int [][]
Why is b considered two dimensional? I realize the "shortcut" declaration
int[] a = null , b[] =null;
is to blame, but why does it make the array two dimensional when only one set of brackets have been written? I find this syntax unclear and obfuscating.