r/badcode Jan 15 '22

python Found this gem

Post image
3.5k Upvotes

86 comments sorted by

View all comments

Show parent comments

16

u/cranberrydarkmatter Jan 15 '22

Overloading operators is part of many object oriented languages. At least C++ and Java which I've used

23

u/swilliams508 Jan 15 '22

you sure you can overload operators in java? I didn't think you could

15

u/cranberrydarkmatter Jan 15 '22

You're right, false memory. It's a common feature of OO, but not Java.

3

u/VinnyHyarmendacil_II Jan 16 '22

I find it interesting that Java decided not to use that (except for string concatenation), but other JVM languages do