how to update object inside object JSON using java and then send to request payload
<p>I am reading a JSON object from file.</p>

<p>I am able to read the value but how can I update the code value for my payload</p>

<pre><code>{
    "products": {
        "productsApp15": {
            "status": "active",
            "attribute_set": "Apparel",
            "name": "productsApp16",
            "product_type": "product",
            "code": "productsApp16"
        }
    }
}
</code></pre>

<p>Import I am using:-</p>

<pre><code>import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import java.util.Iterator;
import java.io.FileWriter;
import javax.json.JsonValue;
import org.json.simple.JSONArray;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
</code></pre>

<p>My Code:-</p>

<pre><code>// read the json file
            FileReader reader = new FileReader(filePath);

            JSONParser jsonParser = new JSONParser();
            JSONObject jsonObject = (JSONObject) jsonParser.parse(reader);

            JSONObject jsonObject1 = (JSONObject) jsonObject.get("products");
            JSONObject jsonObject2 = (JSONObject)jsonObject1.get("productsApp15");
            String firstName = (String) jsonObject2.get("code").toString();

            System.out.println("The first name is: " + firstName);
</code></pre>

<p>But this value is not changing my require data</p>