Java - read a JSON file

Java - read a JSON file

Professor Saad

7 лет назад

161,006 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@ykoh4403
@ykoh4403 - 26.02.2023 21:30

thx sir. your lecture is so helpful.

Ответить
@patrickrayaisse6667
@patrickrayaisse6667 - 14.08.2022 17:47

FileNotFoundException :filename.json : open failed : ENOENT ( No such file or directory) but my data.json file already exists in the project directory

Ответить
@sainiranjan40
@sainiranjan40 - 04.09.2021 23:11

Thank you for the video Professor.
I have json file locally and I am trying to read its values and edit before I send to server. I followed your video but I am getting below error at line 17 in your video reference,
class org.json.simple.JSONArray cannot be cast to class org.json.simple.JSONObject

Please do help!

Ответить
@TarekFaham
@TarekFaham - 04.07.2021 08:32

Fantastic...

Ответить
@mkmb3846
@mkmb3846 - 10.05.2021 16:39

Getting ClassNotFoundException error

Ответить
@butcherbio
@butcherbio - 30.01.2021 16:06

Which shortcut did you use to import package?

Ответить
@pvignatov
@pvignatov - 10.11.2020 08:49

Thank you! The lesson helped me so much!

Ответить
@srin_meow
@srin_meow - 28.07.2020 11:18

FileNotFoundException :((((

Ответить
@vinayakdhage806
@vinayakdhage806 - 05.02.2020 18:17

how to reading data from json file without key?
or
get keys present in json?

Ответить
@umangsharma7447
@umangsharma7447 - 02.12.2019 21:12

String age = (String) jsonObj.get("age");
System.out.println("age is :" + age);


say i have age as key and its value say 25.
which variable should i store it into ? i am getting error while trying to store it into String and casting it to String.
can you please suggest about it ?

Ответить
@vladanulardzic5859
@vladanulardzic5859 - 28.11.2019 17:31

Perfect practical explanation ! Thank you ! Keep on !

Ответить
@quocthai9382
@quocthai9382 - 23.11.2019 13:12

My JSON file has some value is a number , so how can i take it , im trying with Integer instead of String , like in your video String I replace it by Integer but it didnt work . It said ClassCastException
here some of my JSON file :
{
"height":25,
"id":1,
"name":"aaa",
"rotation":0,
"type":"",
"visible":true,
"width":29,
"x":12,
"y":-116
}

Ответить
@ffergg9932
@ffergg9932 - 23.10.2019 18:18

the package org.json.simple.*; doesn't exists anymore

Ответить
@leonardonoronhasantos3644
@leonardonoronhasantos3644 - 03.10.2019 05:25

Thank you my man! You saved me!

Ответить
@alantrammel7179
@alantrammel7179 - 16.08.2019 00:45

Anyone getting error: "class org.json.simple.JSONArray cannot be cast to class org.json.simple.JsonObject" on line 17?

Ответить
@q21r55
@q21r55 - 15.08.2019 11:40

can you if you do this tutorial maybe once again with like multiple json files can you show us how the json looks? cuz me my self i am looking something specific, for example i would like to save each person in a json file but each person has a job, age, birthday etc but i want it to be displayed nicely

Ответить
@stackingflow
@stackingflow - 03.05.2019 05:14

How to make it work for the multiple JSON entries in a file?

Ответить
@Spham99
@Spham99 - 11.04.2019 18:59

I'm a bad listener, so him yelling at me actually gets me to understand xD

Ответить
@vidalperazasanchez6378
@vidalperazasanchez6378 - 29.11.2018 19:16

is possible read external json file from url ?

Ответить
@vigneshpalanisamy7343
@vigneshpalanisamy7343 - 27.11.2018 04:22

Thumbs up! nice explanation

Ответить
@sadmanh0
@sadmanh0 - 26.11.2018 06:25

My Eclipse isn't importing the same Json parser class as you are for some reason

Ответить
@RajeshKumar-im8pi
@RajeshKumar-im8pi - 22.10.2018 14:53

I am getting the below error. Pls help me "Unexpected character (O) at position 11.
at org.json.simple.parser.Yylex.yylex(Yylex.java:610)"

Ответить
@Mettaworldj
@Mettaworldj - 05.08.2018 00:53

Hot Dog! This is a bad man!!

Ответить
@TechBleND97
@TechBleND97 - 04.08.2018 22:10

i have this error (Unexpected character (i) at position 132.) could anyone help me please

Ответить
@siyasangabaduza152
@siyasangabaduza152 - 03.08.2018 13:15

I'm using IntelliJ IDEA, these jar files don not work

Ответить
@coopergates9680
@coopergates9680 - 13.07.2018 17:31

Netbeans 8.1: The org package doesn't have a json package.

Ответить
@kamnijaiswal8060
@kamnijaiswal8060 - 11.07.2018 11:30

I am new to JSON and want to start for begging. Please show the first class too.

Ответить
@simonfelderer440
@simonfelderer440 - 04.06.2018 11:21

Hey, where Can I get your JSON File for the example?
Would like to try it out!

Ответить
@jojojawjaw
@jojojawjaw - 21.05.2018 13:34

Thanks! Great tutorial.

Ответить
@pratikchapadgaonkar8154
@pratikchapadgaonkar8154 - 08.02.2018 23:07

hi. I am getting a exception that JASONArray cant be typecast as a JASONObject. How to handle it?

Ответить
@pratikchapadgaonkar8154
@pratikchapadgaonkar8154 - 08.02.2018 20:31

This gives me syntax error in netbeans 8.2. What development platform is being used in the video?

Ответить
@ALeN8719
@ALeN8719 - 11.11.2017 23:11

what json library r you used? I mean the JAR files that you import to your project

Ответить
@nik4712
@nik4712 - 10.11.2017 12:32

hey guyzz...i have a question..ok..in my android game data..i found a user.json file but when i open it ..it has a tax that i cant read..means it's unreadable and it's not like simple language .so how i conver into readable file and edit..plzz help

Ответить
@smilysuma6865
@smilysuma6865 - 26.10.2017 20:09

what json library r you used?

Ответить
@felipemarcelo3901
@felipemarcelo3901 - 22.07.2017 18:16

Could you send this project to me? [email protected]...

Ответить
@felipemarcelo3901
@felipemarcelo3901 - 22.07.2017 18:15

Which library did you use? Json-simple-1.1.1?

Ответить
@pascalirinel
@pascalirinel - 17.07.2017 12:47

JSONParser constructor takes 3 arguments, how come it does not require you to insert them ?

Ответить