第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

沒(méi)發(fā)現(xiàn)大括號(hào)那有問(wèn)題呢,請(qǐng)大家?guī)兔χ赋鰜?lái)

public?class?Application?{

????public?static?void?main(String[]?args)?{
????????//給出備選菜單,采集用戶輸入
????????System.out.println("查詢最近天氣預(yù)報(bào)");
????????System.out.println("輸入1,未來(lái)24小時(shí)天氣預(yù)報(bào)");
????????System.out.println("輸入2,未來(lái)3天天氣預(yù)報(bào)");
????????System.out.println("輸入3,未來(lái)7天天氣預(yù)報(bào)");
????????System.out.print("請(qǐng)輸入您的選擇:");
????????//接收用戶輸入信息?Scanner
????????Scanner?scanner?=?new?Scanner(System.in);
????????int?i?=?scanner.nextInt();
????????System.out.println("請(qǐng)輸入數(shù)字"?+?i);

????????//進(jìn)行判斷
????????if(i?==?1){
????????????System.out.println("請(qǐng)輸入城市名稱:");
????????????String?city?=?scanner.next();
????????????//接口weatherutils實(shí)例化
????????????WeatherUtils?weatherUtils?=?new?WeatherUtilsImpl();
????????????List<HourWeather>?list?=?weatherUtils.w24h("acbfa8f57a4b4b9cbe59d86c38ec6db2",city);
????????????System.out.println(list);
????????????//格式化判斷輸出
????????????if(list.size()?==?0){
????????????????System.out.println("沒(méi)有查詢到您輸入城市的天氣信息");
????????????}else?{
????????????????//如果list.size()不等于0?則對(duì)HourWeather數(shù)據(jù)進(jìn)行遍歷
????????????????for(HourWeather?hourWeather:list){
????????????????????//定義一個(gè)格式化模板
????????????????????String?template?=?"%s月%s日%s時(shí)?|?%-4s?|?%-20s?|?%-8s?|?%-4s攝氏度?";

????????????????????//返回字符串row,代表一行數(shù)據(jù)
????????????????????String?row?=?String.format(template,new?String[]?{
????????????????????hourWeather.getMonth();
????????????????????hourWeather.getDay();
????????????????????hourWeather.getHour();
????????????????????hourWeather.getWindDirection();
????????????????????hourWeather.getWindPower();
????????????????????hourWeather.getWeather();
????????????????????hourWeather.getTemperature();
????????????????????});
????????????????????//將row數(shù)據(jù)打印輸出
????????????????????System.out.println(row);

????????????????}
????????????}


????????}else?if(i?==?2){

????????}
????}
}

報(bào)錯(cuò)信息:

D:\weather\src\com\zhang\weather\Application.java:44:43

java: 需要'}'


正在回答

1 回答

我發(fā)現(xiàn)問(wèn)題了,錯(cuò)誤的把每個(gè)元素的get方法后面用了分號(hào)

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

沒(méi)發(fā)現(xiàn)大括號(hào)那有問(wèn)題呢,請(qǐng)大家?guī)兔χ赋鰜?lái)

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)