Check out example codes for "JSONObject java". It will help you in understanding the concepts better.

Code Example 1

import org.json.simple.JSONObject;

class JsonEncodeDemo {

   public static void main(String[] args) {
      JSONObject obj = new JSONObject();

	    inputJSON.put("subscriberName", "subscriber");
	    inputJSON.put("msisdn","7055389495");

      System.out.print(obj);
   }
}

Learn ReactJs, React Native from akashmittal.com