views:

634

answers:

4

Hi, I'm used to PHP, and decoding json data is just a line of code. What would be the easiest way to do this in java?

+2  A: 

Hey Amit,

have a look at http://code.google.com/p/json-simple/ maybe it helps ;-)

I tried several JSON parsers. This is my favorite..
ZZ Coder
+6  A: 

Pick one of the libraries from the Java section at the bottom of the json.org page.

moonshadow
+3  A: 

Gson

Userguide

S.Mark
Gson rocks. http://stackoverflow.com/questions/1688099/converting-json-to-java/1688182#1688182
BalusC
A: 

I like Flexjson. It's lightweight and easy to use.

But I admit that I haven't bothered to compare all the alternatives :-)

Eli Acherkan