Home > DeveloperSection > Interviews > Why isn’t there operator overloading?

Posted on    May-21-2011 8:52 AM

 Java Java 
 1 Answer(s)
  1185  View(s)
Rate this:

Awadhendra Tiwari

Total Post:510

Posted on    May-21-2011 12:00 AM

Because C++ has proven by example that operator overloading makes code almost impossible to maintain. In fact there very nearly wasn’t even method overloading in Java, but it was thought that this was too useful for some very basic methods like print(). Note that some of the classes like DataOutputStream have unoverloaded methods like writeInt() and writeByte().

Don't want to miss updates? Please click the below button!

Follow MindStick