Null pointer access: The variable sb can only be null at this location

int[] number = null;
這句不對,數組必須初始化才行,比如 int[] number = new int[3];
別的類似。

類似還有
StringBuffer sb = null;
沒進行實例化
所以需要
StringBuffer sb = new StringBuffer ;
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章