I am using a JSONObject in order to remove a certin attribute I don\'t need in a JSON String:
JSONObject jsonObject = new JSONObject(jsonString);
jsonObject.
Go on JSONObject class Change from HashMap() to LinkedHashMap()
/**
* Construct an empty JSONObject.
*/
public JSONObject() {
this.map = new LinkedHashMap();
}
The LinkedHashMap class extends the Hashmap class. This class uses a doubly linked list containing all the entries of the hashed table, in the order in which the keys were inserted in the table: this allows the keys to be "ordered".