my teacher asked me "Why c++/c## support operator overloading and java don't?"
I have an answer for Java.
anything I read, just said about how to write, define or something else. No answer for "why"
someone can give me a document which I need or the answer.
thanks for reading and sorry about my poor english
Đăng 0 Newbie Poster
Recommended Answers
Jump to PostYou should look for interviews with and documents written by the designers of these languages.
Jump to Postoperator overloading isn't bad in theory, but it has such massive opportunities for abuse, and in the wild is hardly ever used except incorrectly, that the designers of Java decided to do without in order to prevent an entire class of problems relating to the concept.
From operators with side …
Jump to PostThat doesn’t make operator overloading bad. Even Java has certain types that have operator overloads because it is so natural for that type. Take string for example. The
+
operator works with it even though it shouldn’t since there is no operator overloading in the language. If anyone ever gave …
Jump to PostJava being programmed to make bad code harder to write (it's still possible, the moment you make things more fool proof nature creates a batter fool after all) they decided to not include certain capabilities that are extremely easy to abuse and very hard to use correctly, things like operator …
All 15 Replies
Rashakil Fol 978 Super Senior Demiposter Team Colleague
NathanOliver 429 Veteran Poster Featured Poster
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
Rajeev Kumar_1 0 Newbie Poster
NathanOliver 429 Veteran Poster Featured Poster
jwenting 1,905 duckman Team Colleague
NathanOliver 429 Veteran Poster Featured Poster
jwenting 1,905 duckman Team Colleague
NathanOliver 429 Veteran Poster Featured Poster
jwenting 1,905 duckman Team Colleague
Rashakil Fol 978 Super Senior Demiposter Team Colleague

iamthwee
melissad -4 Newbie Poster
cheryllocascio 0 Newbie Poster
mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.