开发者社区 > 云原生 > 容器服务 > 正文

容器中泛型类的在集合中的使用的代码命令有什么?

容器中泛型类的在集合中的使用的代码命令有什么?

展开
收起
游客d7m6sp6tv6n2q 2021-12-14 20:19:57 1666 0
1 条回答
写回答
取消 提交回答
  • public class Test {
        public static void main(String[] args) {
            // 以下代码中List、Set、Map、Iterator都是与容器相关的接口;
            List<String> list = new ArrayList<String>();
            Set<Man> mans = new HashSet<Man>();
            Map<Integer, Man> maps = new HashMap<Integer,
    
     Man>();
            Iterator<Man> iterator = mans.iterator();
        }
    }
    
    
    2021-12-14 20:20:48
    赞同 展开评论 打赏

国内唯一 Forrester 公共云容器平台领导者象限。

相关电子书

更多
阿里云文件存储 NAS 在容器场景的最佳实践 立即下载
何种数据存储才能助力容器计算 立即下载
《容器网络文件系统CNFS》 立即下载