package?com.imooc.javabeginner.second.weatherforecast;
import?com.imooc.weather.HourWeather;
import?com.imooc.weather.WeatherUtils;
import?com.imooc.weather.impl.WeatherUtilsImpl;
import?java.util.List;
import?java.util.Scanner;
public?class?QueryWeather?{
????public?static?void?main(String[]?args)?{
????????String?appCode?=?"xxxxxx";
????????System.out.println("可以選擇的服務如下所示:");
????????System.out.println("1:查詢24h內的天氣信息");
????????System.out.println("2:?查詢3天內的天氣信息");
????????System.out.println("3:?查詢7天內的天氣信息");
????????System.out.print("請選擇所需服務的代號:");
????????Scanner?scanner?=?new?Scanner(System.in);
????????int?i?=?scanner.nextInt();
????????if?(i?==?1){
????????????System.out.print("請輸入所需查詢天氣的城市名稱:");
????????????String?city?=?scanner.next();
????????????WeatherUtils?weatherUtils?=?new?WeatherUtilsImpl();
????????????List<HourWeather>?weatherList?=?weatherUtils.w24h(appCode,?city);
????????????System.out.println(weatherList);
????????}
????}
}

2021-03-10
你第26行appcode要輸入那串控制臺授權碼
2021-02-28
我也是,求問
2021-02-03
我也是,求問