一道筆試題來理順Java中的值傳遞和引用傳遞

前段時間參加了一場面試,其中有一道引用傳遞的題,因爲當時並沒有考慮清楚所以做錯了。  現在來複盤一下,題目如下: private static void change(StringBuffer str11, StringBuffer str12) { str12 = str11; str11 = new StringBuffer("new world"); str12.ap
相關文章
相關標籤/搜索