Java - write a JSON file

preview_player
Показать описание
Java - write a JSON file
Рекомендации по теме
Комментарии
Автор

Everything is "nice & clear" ! Couldn't be more simple ! Thank you. Keep on with such a practical examples.

vladanulardzic
Автор

PERFECT.
WHY NO ONE ELSE UPLOAD A SIMPLE AND SPECIFIC CONTENT SUCH LIKE THIS ?

architect
Автор

where is that myJSON.json saved so that when I use fileReader I am able to pass the name as the parameter?

yifanxu
Автор

Very helpful, I used it as a DataBase.

youtubepooppismo
Автор

On point and clearly explained. Good work

RanjeetkumarYadav
Автор

Totally agree to the top comment, everything is clear and very good explained, thank u!

Timm
Автор

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!

infini
Автор

Can you make a turorial on how to generate a json payload from json schema please

agalyjumaklychev
Автор

How do I get rig of the " " in the key

Rafa_guitars
Автор

I am trying to create a json file but reading the data from a mysql table. Can you do

alexchile
Автор

how to append data without replacing it?

XhekiTanPT
Автор

Great work! Really easy to understand ;)

PihFrags
Автор

i am getting error in the import org.json.simple.JSONObject; package and where to keep the JSON file ????

uttamkumarsharma
Автор

I wanna mod minecraft that's why i learn basic about java and json file

Garfield_Minecraft
Автор

How to append the json file ? I am writing some performance logs and at run time i want to append the output

kalyanijoshi
Автор

sir I am not able to import the JSONObject in my java project why so?

anshuakansha
Автор

where will i get the created json file ?

atularya
Автор

error -> filewriter could not resolve to a type

sanaamjad
Автор

شكرا لك, , هذا الكود مع تغيير القيم

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);

Userabs
Автор

Where is the FileWriter class? Im confused

OmgThatsIncredible