This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.json.JSONArray; | |
import org.json.JSONException; | |
import org.json.JSONObject; | |
public class WeatherDataParser { | |
/** | |
* Given a string of the form returned by the api call: | |
* http://api.openweathermap.org/data/2.5/forecast/daily?q=94043&mode=json&units=metric&cnt=7 | |
* retrieve the maximum temperature for the day indicated by dayIndex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
public class Person | |
{ | |
private String name; | |
private ArrayList<Person> friends; | |
public Person(String name) | |
{ | |
this.name = name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
public class Person | |
{ | |
private String name; | |
private ArrayList<Person> friends; | |
public Person(String name) | |
{ | |
this.name = name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
public class Person | |
{ | |
private String name; | |
private ArrayList<String> friends; | |
public Person(String name) | |
{ | |
this.name = name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
public class ListOfPictures | |
{ | |
public static void main(String[] args) | |
{ | |
ArrayList<Picture> gallery = new ArrayList<Picture>(); | |
gallery.add(new Picture("degas1.jpg")); | |
gallery.add(new Picture("gaugin1.jpg")); | |
gallery.add(new Picture("monet1.jpg")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
public class ListOfPictures | |
{ | |
public static void main(String[] args) | |
{ | |
ArrayList<Picture> gallery = new ArrayList<Picture>(); | |
gallery.add(new Picture("degas1.jpg")); | |
gallery.add(new Picture("gaugin1.jpg")); | |
gallery.add(new Picture("monet1.jpg")); |