JSONObject.getLong("123") 和 (Long)JSONObject.getString("123")的区别

Long id = JSONObject.getLong("123")    id会是Long类型

Long id = (Long)JSONObject.getString("123")   这样会报类型转换错误,因为

这样只会得到Integer类型。

 

posted @ 2020-05-24 14:04  信铁寒胜  阅读(677)  评论(0编辑  收藏  举报