Topic: java支持运算符重载吗?

  Print this page

1.java支持运算符重载吗? Copy to clipboard
Posted by: mosaic
Posted on: 2004-01-06 20:46

如题。

2.Re:java支持运算符重载吗? [Re: mosaic] Copy to clipboard
Posted by: zerol
Posted on: 2004-01-06 20:56

no, even the j2sdk1.5 will not support operator overriding.

3.Re:java支持运算符重载吗? [Re: mosaic] Copy to clipboard
Posted by: taogang
Posted on: 2004-01-07 10:27

only exception is String

4.Re:java支持运算符重载吗? [Re: mosaic] Copy to clipboard
Posted by: mosaic
Posted on: 2004-01-07 10:59

Your smart guys, coulld you please explain why java does not support operator overriding?

5.Re:java支持运算符重载吗? [Re: mosaic] Copy to clipboard
Posted by: Biubiu
Posted on: 2004-01-07 17:23

Why should?

6.Re:java支持运算符重载吗? [Re: zerol] Copy to clipboard
Posted by: zerol
Posted on: 2004-01-08 09:36

http://www.cjsdn.com/post/view?bid=25&id=74343&sty=3&age=0&tpg=1&ppg=1#74343

http://www.zdnet.com.cn/developer/tech/story/0,2000081602,39193401,00.htm

在另一种不同的情况下,操作符过载同样也有很大问题,只不过层次不一样罢了。当“+”根据操作数的类型而代表任何东西的时候,代码的功能就不再透明,难以预料的副作用就会发生。

7.Re:java支持运算符重载吗? [Re: mosaic] Copy to clipboard
Posted by: idler
Posted on: 2004-01-11 05:06

运算符重载和指针一样具有极大的灵活性,但也带来了不确定性,Java的目的之一就是消除这种不确定性带来的潜在问题。


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923