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

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

展开
收起
游客d7m6sp6tv6n2q 2021-12-14 20:19:57 1674 分享
分享
版权
举报
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 举报
    赞同 评论

    评论

    全部评论 (0)

    登录后可评论
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等