new jsonobject java
String message;
JSONObject json = new JSONObject();
json.put("name", "student");
JSONArray array = new JSONArray();
JSONObject item = new JSONObject();
item.put("information", "test");
item.put("id", 3);
item.put("name", "course1");
array.add(item);
json.put("course", array);
message = json.toString();
// message
// {"course":[{"id":3,"information":"test","name":"course1"}],"name":"student"}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);
}
}
Also in JavaScript:
- javascript objet keys comparaison
- Número aleatório JS
- node list files in directory
- react spring
- how to change mui ripple color
- inline javascript modules
- how to get the last eleemnt of an array
- javascript howto get xhr
- node code comment process real time
- angular one array contains any of second
- how to parse json in java
- js get first element by class
- TextInput disable react native
- if keypress javascript
- how can when click buton scrool to another elemtn
- como criar uam seessão com jsp
- ejecutar una funcion js con id html usando jquery
- minecraft fps client that supports linux
- javascript moment
- react useref in useeffect
- add new array at the back of react state
- clone an object javascript
- settimeout node js
- vuejs accessing props from data