看板
[ java ]
討論串[問題] 初學者的幾點小疑問
共 7 篇文章
內容預覽:
> : 因為小弟剛接觸java(自修) 如果覺得問題太蠢還請見諒. > : 問題1:為何n1==n2(結果:false)而i1==i2(結果:true) 他們的值不是都相等嗎?. > : 還是Integer oo = new Integer (xx) 與 Integer oo = xx 二種方式有哪
(還有2401個字)
內容預覽:
※ 引述《war3rd.bbs@ptt.cc (war3rd)》之銘言:. > 以下這二支小程式..... > 程式一:. > public static void main (String[] args){. > Integer n1 = new Integer(47);. > Integer n
(還有1210個字)
內容預覽:
※ 引述《Pistachi.bbs@mobbs.stut.edu.tw》之銘言:. > > Letter x= new Letter();. > > x.c= 'a';. > > System.out.println("1:x.c: "+x.c);. > > f(x);. > > System.ou
(還有319個字)
內容預覽:
※ war3rd.bbs@ptt.cc (war3rd) wrote:. > 以下這二支小程式..... > 程式一:. > public static void main (String[] args){. > Integer n1 = new Integer(47);. > Integer n2
(還有1081個字)
內容預覽:
這是 autoboxing & unboxing 的功能,. 至於為什麼改了數字就不一樣了,. 因為 autoboxing 後在某一段會做 value cached. (減輕產生物件的 cost). http://java.sun.com/developer/JDCTechTips/2005/tt0
(還有761個字)