相关疑难解决方法(0)

为什么Java中没有SortedList?

在Java中有SortedSetSortedMap接口.两者都属于Java的标准集合框架,并提供了一种访问元素的排序方式.

但是,根据我的理解SortedList,Java中没有.您可以使用java.util.Collections.sort()对列表进行排序.

知道为什么它的设计是这样的吗?

java sorting collections

479
推荐指数
6
解决办法
44万
查看次数

在Java 8中从列表创建字符串和对象的映射

我有以下课程:

class Data {
        String systemId;
        String fileName;
        int x;
        int y;

        Data(String systemId, String fileName, int x, int y) {
            this.systemId = systemId;
            this.fileName = fileName;
            this.x = x;
            this.y = y;
        }
        public String getSystemId() {
            return systemId;
        }

        public void setSystemId(String systemId) {
            this.systemId = systemId;
        }

        public String getFileName() {
            return fileName;
        }

        public void setFileName(String fileName) {
            this.fileName = fileName;
        }

        public int getX() {
            return x;
        }

        public void setX(int x) {
            this.x = …
Run Code Online (Sandbox Code Playgroud)

java java-8 java-stream

2
推荐指数
1
解决办法
100
查看次数

标签 统计

java ×2

collections ×1

java-8 ×1

java-stream ×1

sorting ×1