Eclipse消息表示列表无法解析为类型 [英] Eclipse message saying List cannot be resolved to a type

查看:1220
本文介绍了Eclipse消息表示列表无法解析为类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  public class A {
List< Integer> intList = new ArrayList< Integer>();
}

然而,它给我一个错误说:列表无法解析为一个类型ArrayList无法解析为类型。



我需要添加一些库,我该怎么做?

解决方案

您可以按 Shift + Ctrl + O 进行自动导入。


I am trying the following code in eclipse:

public class A {    
    List<Integer> intList = new ArrayList<Integer>();
}

However it gives me an error saying: List cannot be resolved to a type and ArrayList cannot be resolved to a type.

Is there some library I need to add and how do I do that?

解决方案

You can press Shift+Ctrl+O for auto importing.

这篇关于Eclipse消息表示列表无法解析为类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆