I don't see how line 2 can be valid in java... I think it was just a poor example.
for instance, lets say we have a cat object you can't say:
1 2 3 4 5 6 7 8 9 10 11
|
Cat[10] cat = 0;
// this needs to be
Cat[] cat = new cat[10];
// or
Cat[] cat;
cat = new Cat[10] { /* different cat objects */ };
|
this would only work with type int, short, long, or perhaps float. String, double, and all objects would be an error.
as far as standard arrays in java goes, I feel they are much more functional. For instance using arrays is much more useful in java than c, because in c you need to have dodgy workarounds to deal with unknown array sizes. while in java simply
array.length
gives you your size/length.
There's other useful things about them to, such as copyrange(int,int), toString(), search(), sort(), List<Obj>... etc
However this is C++ forum so you can ignore the above :P