简体   繁体   中英

How to read json data in java and display particular output from key value pair

I have json file with data

 ( "date" : "2019-1-2"
   "Group" : "xyz"
   "Bookname" : "harrypotter"
   "Url" : "https:dhdudgussisk"
),
( " date" : " 2015-2-3"
  " Group" : "qbc"
  "Bookname" : "happy"
  "Url" : "https://hdhdjdksksksks"
)

The code has to be in java written in a way such that when I change the input bookname value the output should display its respective url....some one please help me solve this

Lets hope we understood you right, you want to read out of an json with key-value method.

I think what could help you is knowing how to properly parse an json to java.

How to parse JSON in Java

There is a lot of libraries providing this. You should explore the internet before you asked a question which was answered many times and it is not hard to find a relevant tutorial.

For example, the Jackson library can be used there.

Intro to the Jackson .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM