随笔分类 -  java

摘要:引入guava包 阅读全文
posted @ 2019-04-30 14:53 金色元年 阅读(3782) 评论(0) 推荐(0)
摘要:题目:两个线程交替顺序打印,一个输出正整数1到52,一个输出a-zA-Z, 例如 - 1a2b3c4d5e6f7g8h9i10j11k12l13m14n15o16p17q18r19s20t21u22v23w24x25y26z 27A28B29C30D31E32F33G34H35I36J37K38L3 阅读全文
posted @ 2019-03-27 10:15 金色元年 阅读(258) 评论(0) 推荐(0)
摘要:1. List转换String 2. List去除null 3. List比较 4. Map比较 阅读全文
posted @ 2019-01-25 22:55 金色元年 阅读(236) 评论(0) 推荐(0)
摘要:-- 正整数相加 -- test 阅读全文
posted @ 2018-11-25 01:13 金色元年 阅读(350) 评论(0) 推荐(0)
摘要:一、yum安装: 1. 在/etc/yum.repos.d/目录创建文件elasticsearch.repo 2. 添加以下内容 3. 执行yum命令:sudo yum install elasticsearch -y 4. 设置开机启动:sudo chkconfig --add elasticse 阅读全文
posted @ 2018-11-09 23:18 金色元年 阅读(594) 评论(0) 推荐(0)
摘要:一、Lombok简介 Project Lombok is a java library that automatically plugs into your editor and build tools, spicing up your java.Never write another getter 阅读全文
posted @ 2018-08-07 00:05 金色元年 阅读(133) 评论(0) 推荐(0)
摘要:1. Validation using Spring’s Validator interface Spring features a Validator interface that you can use to validate objects. The Validator interface w 阅读全文
posted @ 2018-07-22 14:16 金色元年 阅读(774) 评论(0) 推荐(0)
摘要:jwt官网:https://jwt.io/ 阅读全文
posted @ 2018-07-02 16:43 金色元年 阅读(364) 评论(0) 推荐(0)
摘要:1 import java.util.ArrayList; 2 import java.util.List; 3 4 public class MaxSubSeq { 5 // 例如给定序列{ -2, 11, -4, 13, -5, -2 },其最大连续子序列为{ 11, -4, 13 },最大和为20。 6 // 状态转移方程: sum[i]=max(sum[i-1]... 阅读全文
posted @ 2017-12-19 16:43 金色元年 阅读(360) 评论(0) 推荐(0)
摘要:在Eclipse下使用maven新建立的项目报错。有三个错误,一直没有找到合适的方法,今天终于解决了。 第一个错误:pom.xml报错。 解决办法:运行 maven install. 第二个错误:jsp文件报错,原因:缺少servlet-api包. 解决办法:去maven中央仓库... 阅读全文
posted @ 2015-06-11 22:28 金色元年 阅读(329) 评论(0) 推荐(0)
摘要:1 public class QuickSort { 2 3 //插入排序 4 //插入前的序列是排序好的,将新插入的数值与之前的数值比较 5 //直到找到合适的位置 6 public static int[] quickSort(int[] a... 阅读全文
posted @ 2015-05-11 21:27 金色元年 阅读(249) 评论(0) 推荐(0)
摘要:1 public static void main(String[] args) { 2 File file = new File("D:"+File.separator+"aa.text"); 3 if(!file.exists()){//判断文件是否存在,如果不存在创建... 阅读全文
posted @ 2015-05-07 12:43 金色元年 阅读(155) 评论(0) 推荐(0)
摘要:1.person类 1 //clone方法必须实现Cloneable接口 2 public class Person implements Cloneable { 3 private String name; 4 private int age; 5 public Calen... 阅读全文
posted @ 2015-05-02 00:25 金色元年 阅读(174) 评论(0) 推荐(0)
摘要:1. 2的10次方是多少? 2.65536是2的多少次方? 算着太累,折腾了一个小片段。 1 public class Sum2 { 2 final static int count =2; 3 //输入2的次方,获得2的次方的结果 4 public static i... 阅读全文
posted @ 2015-03-31 00:37 金色元年 阅读(413) 评论(0) 推荐(0)
摘要:1. Set中不保存重复的元素。 2.Set中最常用的是测试归属性,可以查询某个对象是否存在某个Set中。查找成了Set中最常用的操作。 3.HashSet使用了散列。TreeSet将元素存储在红-黑树数据结构中。如果你想对结果排序,一种方式是使用Treeset来代替Hashset4.如果要对结果... 阅读全文
posted @ 2015-03-24 15:36 金色元年 阅读(507) 评论(0) 推荐(0)
摘要:1 Map map = new HashMap(); 2 map.put(1, "a"); 3 map.put(2, "b"); 4 5 System.out.println("(1):"); 6 //1.Map输出... 阅读全文
posted @ 2015-03-22 15:16 金色元年 阅读(456) 评论(0) 推荐(0)