Tuesday, November 29, 2011
Core Java Interview Questions :Why operator overloading is not there in java?
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().:I belive Operator Overloading exists in Java.:Operator overloading makes the code more complex and less readable. Also we could define different methods in the same class like plus(),plusplus(), minus() etc and thus bringing operator overloading in Java:I guess,Operator overloading is not supported in Java as its create lot of confusion instead of solving the problems. :Operator Overloading
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment