java 集合的使用 (一)
2024-09-09 21:36:53
1、使用整型列表
List<int> lstInt=new List<int>();
结果不对,报的错误是:Syntax error, insert "Dimensions" to complete ReferenceType
然后百度之:使用列表时,必须使用引用类型,不能使用基本类型的int
改成:
List<Integer> lstInt=new List<Integer>();
时报错:Cannot instantiate the type List<Integer>
再百度:List<int> lstInt=new ArrayList<Integer>(); 写成这样才对。
2、使用List<String>
List<String> lstStr=new LinkedList<String>();
3、使用Map
引入import java.util.HashMap;
java语句:Map<String, Object> map = new HashMap<>();
最新文章
- 前端自动化测试 —— TDD环境配置(React+TypeScript)
- JavaScript对象状态
- AutoVFL(适配)
- python简明手册学习
- English随笔1
- Searching External Data in SharePoint 2010 Using Business Connectivity Services
- vb6 判断64位操作系统
- (转)C#中的Dictionary字典类介绍
- python中的builtin函数详解-第二篇
- storm启动流程
- 模仿快递路线图的html, css 样式
- P1130 红牌
- tomcat去除项目名部署
- FluentAPI详细用法
- 汇编-MOV指令
- Linguistic Data Consortium (LDC)
- ckeditor源码编辑模式,添加style、javascript内容丢失的解决
- Selenium自动化测试第二天(上)
- sql one
- TCP深入详解