赞
踩
In c++, we can perform the operator overloading. But Java is also a Object oriented language. So why java doesn't support overloading?
解决方案
Actually, it does support operator overloading... of a very limited, built-in only nature. For instance "+" is overloaded for String's in addition to the usual arithmetic.
Of course, most people want to know why Java does not support user-defined operator overloading. :-) The simplest answer seems to be that the Java creators did not, at the time, see any clean way to add it to the language without making Java a mess (like C++) in the process.
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。