答案 0 :(得分:2)
URL url = new URL("http://rate-exchange.appspot.com/currency?from=USD&to=EUR&q=3");
URLConnection yc = url.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null){
System.out.println(inputLine);
}
in.close();
Gson gson = new Gson();
Rate r = gson.fromJson(inputLine,Rate.class);
答案 1 :(得分:1)