{
"array": [{
"command": "!&>D(<&!'&E'e8n!i&6P&!&()o^4{i_&mi24884675236258&74R5)",
"port": "118030831074908",
"type": "sendmsg"
}],
"code": "00000"
}
JSONObject jsonObject = JSONObject.fromObject(str);
JSONArray jsArr=jsonObject.getJSONArray("array");
JSONObject jsObj= jsArr.getJSONObject(0);
System.out.println(jsObj.get("port"));
String str="{
" +
" "array": [{
" +
" "command": "!&>D(<&!'&E'e8n!i&6P&!&()o^4{i_&mi24884675236258&74R5)",
" +
" "port": "118030831074908",
" +
" "type": "sendmsg"
" +
" }],
" +
" "code": "00000"
" +
"}";
JSONObject json= JSONObject.parseObject(str);
System.out.println(json.getString("code"));
JSONArray array=json.getJSONArray("array");
System.out.println(json.getString("array"));
System.out.println(array);
System.out.println(array.getJSONObject(0).getString("port"));