yeah, i had noticed that too (String  a = new String ; compiles!).
Originally posted by Chandra Kota: Even I'm confused with this. When we declare and Initialize the array, there is no problem. But when we separate declaration and initialization, we are having the problem. Can anyone explain whats wrong with that.
Just a "point of view" and maybe even a flawed one..... but
when you separate the declaration from the initialization like that it must be done inside a method because you can't have code ( a = String ) OUTSIDE of a method. Executable code must be in a method.....
SCJP - 86% - June 11, 2009