Комментарии:
شكرا لك ,, هذا الكود مع تغيير القيم
JSONObject obj = new JSONObject();
obj.put("name", "b");
obj.put("age", "20");
JSONArray list = new JSONArray();
list.add("jeddah");
list.add("makkah");
list.add("madinah");
obj.put("city", list);
try(FileWriter file = new FileWriter("testJSON.json",true) ){
file.write(obj.toString());
file.flush();
}catch(Exception e){
e.printStackTrace();
}
System.out.println(obj);
I wanna mod minecraft that's why i learn basic about java and json file
Ответитьthanks! but you could explain better why we need to create the JSON array, for example... I'm glad you explained why we should use the file writer inside the try parentheses. ty!
ОтветитьTotally agree to the top comment, everything is clear and very good explained, thank u!
Ответитьsir I am not able to import the JSONObject in my java project why so?
ОтветитьDon't works
ОтветитьGreat work! Really easy to understand ;)
ОтветитьThank You So Much Sir!!
Ответить2021 April 6th.
ОтветитьCould you please provide a video on merge json files
ОтветитьOn point and clearly explained. Good work
ОтветитьCan you make a turorial on how to generate a json payload from json schema please
ОтветитьEverything is "nice & clear" ! Couldn't be more simple ! Thank you. Keep on with such a practical examples.
Ответитьwhere will i get the created json file ?
ОтветитьHow to append the json file ? I am writing some performance logs and at run time i want to append the output
ОтветитьI am trying to create a json file but reading the data from a mysql table. Can you do that??????
ОтветитьVery helpful, I used it as a DataBase.
Ответитьerror -> filewriter could not resolve to a type
ОтветитьThanks Saad. Greeting from Mexico.
Ответитьi am getting error in the import org.json.simple.JSONObject; package and where to keep the JSON file ????
ОтветитьHow can I splite it in many lines
Ответитьwhere is that myJSON.json saved so that when I use fileReader I am able to pass the name as the parameter?
ОтветитьPERFECT.
WHY NO ONE ELSE UPLOAD A SIMPLE AND SPECIFIC CONTENT SUCH LIKE THIS ?
How do I get rig of the " " in the key
ОтветитьWhere is the FileWriter class? Im confused
Ответитьhow to append data without replacing it?
Ответить