關(guān)于添加新對(duì)象的問題
為什么這樣不對(duì)studentList.add(new student("k","Lucy"));,這樣是對(duì)的studentList.add(new student(k+"","Lucy"));。那個(gè)k是Integer類型的
為什么這樣不對(duì)studentList.add(new student("k","Lucy"));,這樣是對(duì)的studentList.add(new student(k+"","Lucy"));。那個(gè)k是Integer類型的
2016-08-11
舉報(bào)
2016-08-11
k+“”這樣可以吧integer類型轉(zhuǎn)化為String類型
2016-08-11
int類型的不用引號(hào),string類型用引號(hào)