繁体   English   中英

导入java.util.Collections无法解析

[英]The import java.util.Collections cannot be resolved

package Collection_1;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;


public class ArrayListMethods {

    public static void main(String[] args) 
    {
        
        List<Integer> intList = new ArrayList<Integer>();
        intList.add(9);
        intList.add(0);
        Collections.sort(intList);
            
        }       

}

This code is giving the error The import java.util.Collections cannot be resolved while importing import java.util.Collections . 我正在使用 Collections class 的排序方法。 我正在使用 eclipse IDE 来编写代码。 如果有人有任何想法,请尝试回答。

Ctrl+Shift+O,删除所有导入并执行此操作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM