亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

為什么我到輸入城市的那一步就報錯

package?com.imooc.weather;

import?com.imooc.weather.impl.WeatherUtilsImpl;
import?sun.plugin.dom.exception.BrowserNotSupportedException;

import?java.util.List;
import?java.util.Scanner;

public?class?Application?{
????public?static?void?main(String[]?args)?{
????????System.out.println("查詢最近天氣預報");
????????System.out.println("輸入1:查詢未來24小時天氣預報");
????????System.out.println("輸入2:查詢未來3天天氣預報");
????????System.out.println("輸入3:查詢未來7天天氣預報");
????????System.out.print("請輸入您的選擇:");
????????Scanner?scanner=?new?Scanner(System.in);
????????int?i=?scanner.nextInt();
????????System.out.println("用戶輸入數字"+i);
????????if?(i==1){
????????????System.out.println("請輸入城市名稱查詢為24小時天氣預報");
????????????String?city=?scanner.next();
????????????WeatherUtils?weatherUtils?=new?WeatherUtilsImpl();
????????????List<HourWeather>?weatherList?=?weatherUtils.w24h("6196c9db162949e78158039af608da0c",city);//有問題
????????????System.out.println(weatherList);
????????????if?(weatherList.size()==0){
????????????????System.out.println("抱歉,未收錄您查詢的城市天氣數據");
????????????}else?{
????????????????for?(HourWeather?hourWeather:?weatherList){
????????????????????String?template=?"%s月%s日%s時|%s|%s|%s|%s℃";
????????????????????String?row=?String.format(template,new?String[]{
????????????????????????????hourWeather.getMonth(),
????????????????????????????hourWeather.getDay(),
????????????????????????????hourWeather.getHour(),
????????????????????????????hourWeather.getWindDirection(),
????????????????????????????hourWeather.getWindPower(),
????????????????????????????hourWeather.getTemperature(),
????????????????????});
????????????????????System.out.println(row);


正在回答

1 回答

把最上面自動引用的的包刪除了

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

為什么我到輸入城市的那一步就報錯

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號