• Post Reply Bookmark Topic Watch Topic
  • New Topic

Operator Overloading  RSS feed

 
vamsee
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some one told me that it is possible to achieve operator overloading in JAVA. Whether it is possible, if so how to achieve it.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, it's not possible. He probably confused it with method overloading.
 
Vicken Karaoghlanian
Ranch Hand
Posts: 522
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Operator overloading is not supported in Java.

You may want to try Groovy, i have never used it before and i have no idea how it works.

Operator overloading has been criticized a lot because it allowed developers to give operators different functionality depending on the types of their operands. From my personal point of view there is no need to implement it in java. It is simply... too complicated and confusing.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
vamseeeeeeeee krishna,

Welcome to JavaRanch!

We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.

I'm thinking that a few of the e's in your display name aren't sincere.

Thanks Pardner! Hope to see you 'round the Ranch!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!