can anyone help me, i'am new on java programing
let say i have JSONArray with this data below :
[{
"STATUSUPDATE": 0,
"IDSERV": "2"
}, {
"STATUSUPDATE": 0,
"IDSERV": "3"
}, {
"STATUSUPDATE": 0,
"IDSERV": "1"
}]
How to update STATUSUPDATE to 1 in IDSERV 2
How to update STATUSUPDATE to 2 in IDSERV 3
and was trying to loop the data
for (int i=0; i < array.length; i++){
JSONObject itemArr = (JSONObject)array.get(j);
if(itemArr.get("IDSERV").equals(2)){
//should be itemArr.set(with new val)
//but method *set* can cal; only on JSONArray not an JSONObject
//and looping the next one
}
}
can anyone help me