Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Milan Epps
1,077 PointsChallenge 1 - Parsing Data how do you set String variables to the values from 'data.json' using the 'jsonData' object?
This is what I've got, but I keep getting compiler errors:
String name = jsonData.getJSONString("Treehouse Book Series");
String publisher = jsonData.getJSONString("Wiley");
String language = jsonData.getJSONString("English");
1 Answer
Daniel Hartin
18,106 PointsHi Milan
You have added in an incorrect method call which is the reason for the complier errors. You should be Using a line such as:
String name = jsonData.getString("Treehouse Book Series");
Simply remove the "JSON" between the get and String on each of your declarations and you should be set, although let me know if you have anymore problems
Thanks Daniel
Milan Epps
1,077 PointsHey Daniel,
I'm still getting errors. Any other suggestions?
B Kelly
3,143 PointsLooks like you also mixed up the name and publisher strings.
Ryan Duchene
Courses Plus Student 46,022 PointsRyan Duchene
Courses Plus Student 46,022 PointsEdited your comment to add syntax highlighting. :)