- 博客(4)
- 收藏
- 关注
原创 Java—LinkedHashMap
LinkedHashMap是HashMap的子类,保证在遍历map元素时,可以按照添加的顺序实现遍历,对于频繁的遍历操作,它的执 行效率高于HashMap.一些基本操作:存储实现:put(Key,Value)读取:get(Key)遍历:LinkedHashMap<String,Integer> list=new LinkedHashMap<String,Integer>();for(Entry<String, Integer> entry:list.entry
2021-10-31 16:45:39
777
原创 Java—统计一篇英文文章中出现的不重复单词的个数
题目:输入一篇英文文章,碰到"!!!"的时候停止,输出文章中出现的不重复单词的个数(注意:单词不区分大小写,如:The和the为一个单词)输入格式:一篇英文文章,以"!!!"结尾输出格式:不重复单词的个数输入样例:Unmanned aerial vehicles have been adopted in the inspection of violations Procurators will file public interest litigations against perpetrat
2021-10-31 15:53:38
1444
原创 MySQL笔记
MySQL的常见命令1.查看当前所有数据库show databases;2.打开指定的库 use 库名;3.查看当前库的所有表show tables;4.查看其它库的所有表show tables from 库名;5.创建表create table 表名( 列名 列类型, 列名 列类型, …)6.查看表结构desc 表名;7.查看服务器的版本方式一:登录mysql服务端select version();方式二:没有登录mysql服务端mysql --ve
2021-10-30 21:59:34
104
原创 Java—自定义异常类
Java—自定义异常类定义IllegalScoreException异常类,代表分数相加后超出合理范围的异常。该异常是checked exception,即希望该异常一定要被捕获处理。定义IllegalNameException异常类,代表名字设置不合理的异常。该异常是unchecked exception定义Student类。属性:private String name;private int score;方法:toString //自动生成setter/gett
2021-10-30 21:47:28
813
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人