文件名称:java
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:7.99kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
1.根据一个已有的file c:\student.csv, 将所有学生数据读到一个ArrayList中.ArrayList中的元素类型是Student类型。
2.将得到的这个ArrayList按照小组号分组,构造一个HashMap。 Map的key是组号,value是一个ArrayList,这个arraylist中包含了所有在这个小组下的Student
3. 遍历这个HashMap,打印出每组下学生的学号。 注意,要求打印学号的除前3位其他的字符。比如学号为HSG1001,打印出来就是1001
提示: 1. 可以用string.split(“,”)方法来获得一个数组
2.可以用map.keySet.contains(obj) 方法来判断是否包含了某个元素-1. According to an existing file d: \ student.csv, read all the student data in an ArrayList. ArrayList type of elements in the Student type. 2. Will be in accordance with the group number of this ArrayList groups, construct a HashMap. Map key is the group number, value is an ArrayList, the arraylist contains all in this group under the Student 3. Traverse the HashMap, print out each group of students under the student number. Note that the required number printed school other than the first 3 characters. Such as the school number is HSG1001, print is the 1001 prompt: 1. String.split (" ," ) method can be used to obtain an array 2. Can map.keySet.contains (obj) method to determine whether it contains a certain element
2.将得到的这个ArrayList按照小组号分组,构造一个HashMap。 Map的key是组号,value是一个ArrayList,这个arraylist中包含了所有在这个小组下的Student
3. 遍历这个HashMap,打印出每组下学生的学号。 注意,要求打印学号的除前3位其他的字符。比如学号为HSG1001,打印出来就是1001
提示: 1. 可以用string.split(“,”)方法来获得一个数组
2.可以用map.keySet.contains(obj) 方法来判断是否包含了某个元素-1. According to an existing file d: \ student.csv, read all the student data in an ArrayList. ArrayList type of elements in the Student type. 2. Will be in accordance with the group number of this ArrayList groups, construct a HashMap. Map key is the group number, value is an ArrayList, the arraylist contains all in this group under the Student 3. Traverse the HashMap, print out each group of students under the student number. Note that the required number printed school other than the first 3 characters. Such as the school number is HSG1001, print is the 1001 prompt: 1. String.split (" ," ) method can be used to obtain an array 2. Can map.keySet.contains (obj) method to determine whether it contains a certain element
(系统自动生成,下载前可以参看下载内容)
下载文件列表
新建文件夹/student.csv
新建文件夹/test2.rar
新建文件夹/上机2.doc
新建文件夹
新建文件夹/test2.rar
新建文件夹/上机2.doc
新建文件夹
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.