为了账号安全,请及时绑定邮箱和手机立即绑定

麻烦各位老师看一下,为什么我这里返回的结果是空的?

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);
        }
    }
}

http://img1.sycdn.imooc.com//5ff824780001206c15550306.jpg

正在回答

代码语言

3 回答

你第26行appcode要输入那串控制台授权码

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

我也是,求问

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

我也是,求问

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

举报

0/150
提交
取消

麻烦各位老师看一下,为什么我这里返回的结果是空的?

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信