Forums Register Login

Operator Overloading

+Pie Number of slices to send: Send
Some one told me that it is possible to achieve operator overloading in JAVA. Whether it is possible, if so how to achieve it.
+Pie Number of slices to send: Send
No, it's not possible. He probably confused it with method overloading.
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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!
Do not threaten THIS beaver! Not even with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1309 times.
Similar Threads
How to add two Number?
Advice on BigDecimal vs. double
interview question
operator overloading
Doubt.......null?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 00:07:51.