Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-23-2012, 01:15 PM   PM User | #1
Jigar
New to the CF scene

 
Join Date: Oct 2012
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Jigar is an unknown quantity at this point
Angry How to read child node from root node0 in json using java

library used com.google.gson

try{
JsonReader reader=new JsonReader(new FileReader("E:/nagesh workspace/practice/WebContent/jsnf/newProject.json"));

reader.beginObject();
while(reader.hasNext())
{

String name = reader.nextName();
System.out.println(name);
if("Student".equals(name))
{
System.out.println("student list count = "+name.);
}
else if (name.equals("Name")) {
System.out.println(reader.nextString());
} else if (name.equals("Address")) {
System.out.println(reader.nextString());
}
else
{
reader.skipValue();
}
}

reader.endObject();
reader.close();
}
catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}

this is my code..
plzzz help me if anyone know this.....
Jigar is offline   Reply With Quote
Old 10-23-2012, 03:44 PM   PM User | #2
devnull69
Senior Coder

 
Join Date: Dec 2010
Posts: 2,245
Thanks: 10
Thanked 531 Times in 525 Posts
devnull69 will become famous soon enough
This is a Javascript forum, but your question is about Java

Wrong forum!
devnull69 is offline   Reply With Quote
Reply

Bookmarks

Tags
java, json

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:33 AM.


Advertisement
Log in to turn off these ads.