void setup() { JSONObject obj = loadJSONObject( "phonebook.json" ); String fname = obj.getString( "firstName" ); String lname = obj.getString( "lastName" ); println( "Phone numbers for " + fname + " " + lname + ":" ); JSONArray phones = obj.getJSONArray( "phoneNumbers" ); for ( int idx = 0; idx < phones.size(); ++idx ) { JSONObject record = phones.getJSONObject( idx ); String type = record.getString( "type" ); String number = record.getString( "number" ); println( " [" + type + "]: " + number ); } }