關於對象參數是傳值還是傳引用的問題。

y是數據類型對象,把對象傳遞給 testForInteger(Integer x)方法,方法體裏面累加1傳回去。 爲什麼y值沒變化,對象不是應該傳引用嗎?只有基本數據類型才傳值。 public class main1 {     public static void main(String[] args) {         Integer y=1;         testInteger tes
相關文章
相關標籤/搜索