Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

OPERATOR OVERLOADING ?

 
manusks sharma
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I HAVE READ SOMEWHERE THAT UNLIKE MANY OTHER PROGRAMMING LANGUAGES ,JAVA DOES NOT SUPPORT OPERATOR OVERLOADING;BUT THEN WHAT ABOUT + OPERATOR? DOES IT LEAD TO CONCATENATION AS WELL AS ADDITION (AND IS HENCE BEING OVERLOADED)???
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SORRY TO HEAR ABOUT YOUR BROKEN CAPS LOCK KEY. HERE, MAYBE I CAN UNSTICK IT... there, that's better.
The built-in "+" operator is indeed overloaded to mean string concatenation as well as addition. Depending on the language you're comparing Java to, you might also think that "/" (for example) is overloaded to mean both integer and floating-point division.
But Java doesn't let you define your own meanings for operators, and that's what you read. The built-in meanings are all you've got.
 
Vicken Karaoghlanian
Ranch Hand
Posts: 522
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ernest Friedman-Hill:
SORRY TO HEAR ABOUT YOUR BROKEN CAPS LOCK KEY. HERE, MAYBE I CAN UNSTICK IT... there, that's better.

*Vicken rolling around laughing his guts out*
[ December 26, 2003: Message edited by: Vicken Karaoghlanian ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic