Java Language JSON in Java JSON Builder - chaining methods

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!


You can use method chaining while working with JSONObject and JSONArray.

JSONObject example

JSONObject obj = new JSONObject();//Initialize an empty JSON object 
//Before: {}
//After: {"name":"Nikita","age":30,"isMarried":true}


JSONArray arr = new JSONArray();//Initialize an empty array
//Before: []
//After: ["Stack","Over","Flow"]

Got any Java Language Question?