Dive Into Java?
danb_83 at yahoo.com
Tue Oct 10 05:33:12 CEST 2006
On Oct 9, 11:40 am, Bjoern Schliessmann
<usenet-mail-0306.20.chr0n... at spamgourmet.com> wrote:
> Diez B. Roggisch wrote:
> >> because [Java] wanted to be new and good but took over much of C++'s
> >> syntax and made it even weirder,
> > Even weirder? Care to explain?Example:
> int spam = 5;
> String eggs = new String();
> The latter seems totally unnecessary to me, as well as being too
It is! All you have to write is
String eggs = "";
Unfortunately, the other object types don't have literals.
> why couldn't they go the simple way as in Python and
> just state
> String eggs;
> -- is it because in C++ it'd mean something different?
Can't be, because Java already uses the syntax for something different
More information about the Python-list