[921] in java-interest
Re: Operator Overloading
daemon@ATHENA.MIT.EDU (Thomas Ball)
Tue Aug 15 16:33:32 1995
Date: Tue, 15 Aug 1995 09:25:30 -0700
From: Thomas.Ball@Eng.Sun.COM (Thomas Ball)
To: krom@cgi.com
Cc: java-interest@java.Eng.Sun.COM
> Which of these is simpler to understand?
>
> String a = "Hello ";
> String b = "world.";
>
> String c = a + b;
>
> or
>
> String a = "Hello ";
> String b = "world.";
>
> String c = new String(a);
> c.concat(b);
>
> To me, the first example is more intuitive and obvious.
Yes, but isn't it interesting that the only examples operator-overloading
proponents use are either the one above or numeric types such as matrices?
Java already supports the above as a special hack for Strings. You'll
find it much more difficult to come up with a compelling example using
any of Java's AWT or Net classes.
Tom
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com