Skip to main content

New Operator

6 replies [Last post]
dimkadimon
Offline
Joined: 2004-10-16
Points: 0

I think there should be a new operator. This operator is .= and it will be analagous to +=

So instead of doing:

text=text.toLowerCase();

We can now write

text .= toLowerCase();

What do you guys reckon?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
monika_krug
Offline
Joined: 2004-10-14
Points: 0

> Somehow I can't see any meaningful use for this.

Well, one example is stated above:
text .= toLowerCase();

Meaningful enough for me. Not more and not less meaningful than having operators like += (which I thought to be very meaningless when I started to learn Java from previously only knowing Pascal, but I use it often now).

Monika.

patrikbeno
Offline
Joined: 2004-10-11
Points: 0

-1

nice but really not worth the effort. don't waste your time with this, SUN.

ahoma
Offline
Joined: 2003-06-20
Points: 0

Somehow I can't see any meaningfull use for this.

vhi
Offline
Joined: 2004-10-11
Points: 0

Neither can I.

monika_krug
Offline
Joined: 2004-10-14
Points: 0

Looks like a good idea to me, even though it would only be useful for immutable objects like Strings, Integers etc.

Monika.

dimkadimon
Offline
Joined: 2004-10-16
Points: 0

Even so I think it will be useful.