-
1、创建一个Customer类,类的属性有:姓名、年龄、性别,创建两个对象,张三、18、男,李四、21、女,把这两个元素存入ArrayList对象中,并再从ArrayList中读取出来。
Java的集合框架主要由一组用来操作对象的接口组成,不同接口描述一组不同数据类型。核心接口主要有:Collection、List、Set和Map。
图3- 10 框架图
表3- 4 集合区分列表
集合 是否有序 是否可重复
Collection 否 是
List 是 是
Set AbstractSet 否 否
HashSet
TreeSet
是
Map AbstractMap 否 使用key-value来映射和存储数据,Key必须惟一,value可以重复
HashMap
TreeMap 是
遍历集合中的元素,一种最常用的遍历方法是使用迭代器Iterator接口。每个集合类都提供了iterator方法以返回一个迭代器,通过这个迭代器,可以完成集合的遍历或删除操作,迭代器的使用步骤如下:
1) 通过iterator方法得到集合的迭代器;
2) 通过调用hasNext方法判断是否存在下一个元素;
3) 调用next方法得到当前遍历到的元素。
Iterator iterator = arrayList.iterator();
while (iterator.hasNext()) {
String str = iterator.next();
2、HashMap与TreeMap
HashMap通过hashcode对其内容进行快速查找,而TreeMap中所有的元素都保持着某 种固定的顺序
需要存储有序元素使用Tre
- 2022-03-19 04:14:43下载
- 积分:1
-
population
小型户籍管理系统,可以实现基本的增删改查功能(Small household registration management system)
- 2018-01-07 14:19:23下载
- 积分:1
-
a simple chat program, please speak up!
一个简单的聊天程序,请大家多提意见!-a simple chat program, please speak up!
- 2022-01-30 15:26:59下载
- 积分:1
-
HAVA SSH2开发的BBS,配置后即可运行
HAVA SSH2开发的BBS,配置后即可运行-HAVA SSH2 development of BBS, configured to run
- 2022-07-16 22:00:47下载
- 积分:1
-
gundong
实现滚动特效,在文字和图片滚动时,实现无间隙滚动。(Scroll to achieve special effects, in words and pictures rolling, achieve seamless scrolling.)
- 2011-06-13 15:05:18下载
- 积分:1
-
ssms
学生成绩管理系统(ssms)【Student Score Manage System】
学生成绩管理系统使用说明
1.新建数据库ssms,将ssms.sql导入该数据库
2.用解压文件打开ssms.war, 打开ssms.warWEB-INFclassesc3p0-config.xml文件,修改服务器所在数据库用户名和密码
3.将ssms.war文件放入tomcat/webapps目录下
4.启动tomcat服务器
5.打开浏览器,输入 localhost:8080/ssms 进入登录界面
6.输入用户名和密码访问系统
用户名:admin
密码:111111
教师账号:
2012
2011
2010
2009
2008
学生账号:
201301001
201302002
201401001
201402002
密码都为:111111
也可将ssms.zip项目文件导入eclipse使用
注:将src下c3p0-config.xml中的用户名和密码改为自己数据库的用户名和密码(Student Score Management System (ssms)
Student Performance Management System Instructions
1.Create a new database ssms, import ssms.sql into the database
2. Open ssms.war with the extracted file, open the ssms.warWEB-INFclassesc3p0-config.xml file, and modify the database username and password of the server.
3. Put the ssms.war file in the tomcat/webapps directory.
4. Start the tomcat server
5. Open a browser and type localhost:8080/ssms to enter the login screen.
6. Enter the username and password to access the system
7. Username: admin Password: 111111
8. Teacher account number: 2012 2011 2010 2009 2008
9. Student account number: 201301001 201302002 201401001 201402002
The passwords are all: 111111
You can also import the ssms.zip project file into eclipse.
Note: Change the username and password in c3p0-config.xml under src to the username and password of your own database.)
- 2021-04-09 18:59:00下载
- 积分:1
-
DeviceManagerAct
设备管理系统毕业论文 ,里面有相关的照片及相关的代码,等等(Device Manager)
- 2011-07-22 21:25:50下载
- 积分:1
-
swing组件的使用
swing组件的使用-swing the use of components
- 2022-03-03 00:21:26下载
- 积分:1
-
wikilinks-master
基于维基百科的实体链接程序.实现了从文字链接到维基百科词条的功能(a program based one the wiki .used for the entity link example.it can be used on the knowledge graph .)
- 2017-05-18 14:54:15下载
- 积分:1
-
JOGL(支持opengl2.0)
注意:使用时打开NetBeans IDE 7.1.2新建JOGL工程,此时会出错即界面工具不能加载,不管它进入你保存工程的目录,将里面的所有的*.DLL文件复制放入,JAVA的bin目录中即可,再次打开时会发现可以使用界面设计器了
- 2022-04-18 04:39:01下载
- 积分:1