posted 21 years ago
It should compile, according to my reading of the JLS:
Concatenation (and toString() ) are performed by the println() method. When concatenating String objects with other objects, the value being concatenated is evaluated as to whether it's a value, a primitive, or an object.
If a reference value is null, it is converted to the String "null". That's one String in this example. Also, if the value is boolean, it is treated as though constructed using new Boolean( value ).toString(). There's the "true" part in this example.
See JLS, Third Edition, 15.18.1
I don't know why 1.4.2 would not let it compile when 1.4.1 does. Can you copy and post your source code?
Regards,
Jeff
Give a man a fish, he'll eat for one day. Teach a man to fish, he'll drink all your beer.
Cheers, Jeff (SCJP 1.4 all those years ago...)