[Bluej-discuss] concatenating an index value with a note ex 4.15
Rudi Lutz
rudil at sussex.ac.uk
Thu Oct 5 11:34:38 BST 2006
I certainly agree that they should have used a different symbol e.g.
:: or something. the overloading of + is one of the biggest sources of
confusion to beginners.
Regards,
Rudi
PS I wouldn't mind the "auto-conversion" if a different symbol had
been used for concatentation. It can be explained to beginners as
concatenating a "printing form" of objects/values, and later they can
be told about the toString() method.
On 05/10/06, Gordon Royle <gordon at csse.uwa.edu.au> wrote:
>
> On 05/10/2006, at 5:13 PM, Michael Kölling wrote:
>
> >
> > It all will work, since Java has a rule that says: If any of the
> > operands of a + operator is a String, then the other operand will be
> > converted to a String, and the '+' will be interpreted as String
> > concatenation.
>
> Personally, I think the decisions to overload + and THEN to do this
> auto-conversion are two of the worst design decisions of Java...
>
> _______________________________________________
> mailing list bluej-discuss at bluej.org
> To unsubscribe or change your preferences, go to
> http://lists.bluej.org/mailman/listinfo/bluej-discuss
>
More information about the bluej-discuss
mailing list