看板
[ java ]
討論串[問題] 一個關於reference的問題...
共 2 篇文章
首頁
上一頁
1
下一頁
尾頁
內容預覽:
簡單來說,你所替換掉的只有 tryToReplace 方法中 otherObject. 變數所指向的物件而已,不影響 main 裡面的 s1 和 s2. // 在這邊 otherObject == s2. // 到這邊 otherObject == s1. 無論怎麼更變,充其量也只有替換掉 tryT
(還有139個字)
內容預覽:
這是上課時, 老師提供的範例. 要執行的程式碼如下. public class ParametersDemo. {. public static void main(String[] args). {. DemoSpecies s1 = new DemoSpecies( ),. s2 = new D
(還有1709個字)
首頁
上一頁
1
下一頁
尾頁