看板 java 關於我們 聯絡資訊
※ 引述《tkcn (小安)》之銘言: : 而因為這個 bug 的 priority 是 Vary Low, : 所以拖了近六年至今還沒被處理掉....XD http://download.oracle.com/javase/1.5.0/docs/guide/language/varargs.html So when should you use varargs? As a client, you should take advantage of them whenever the API offers them. Important uses in core APIs include reflection, message formatting, and the new printf facility. As an API designer, you should use them sparingly, only when the benefit is truly compelling. Generally speaking, you should not overload a varargs method, or it will be difficult for programmers to figure out which overloading gets called. Translation 1: Just because you can, it doesn't necessarily mean you should. Translation 2: Don't f* do it. XD If anyone's interested in this sort of (fun) stuff, read Eric Lippert's blog. It's full of this kind of (fun) stuff. ;) http://blogs.msdn.com/b/ericlippert/ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 65.87.177.87