
Java Excellent
文章平均质量分 77
lstrue
对软件开发感兴趣,喜欢独立思考和解决问题
展开
-
Java Comparator相关
//重写Comparator。需要明确范型的类,因此只能是类不能是primative类型,比如int[]就不行,需要转化为Integer[]。compare如果是a - b就是升序,compareTo也是一样的。list可以用stream不需要写comparator。 public void sortStringArray(String[] strArr) { A...原创 2020-04-26 06:54:06 · 180 阅读 · 0 评论 -
hibernate 三种状态深入分析
在Hibernate中有三种状态,对它的深入理解,才能更好的理解hibernate的运行机理,刚开始不太注意这些概念,后来发现它是重要的。对于理解hibernate,JVM和sql的关系有更好的理解。对于需要持久化的JAVA对象,在它的生命周期中有三种状态,而且互相转化。1, 临时状态(Transient):用new创建的对象,它没有持久化,没有处于Session中,处于此状态的转载 2010-03-30 10:34:00 · 257 阅读 · 0 评论 -
Polymorphism(多态)
一篇关于多态的好文,出处:http://www.tutorialspoint.com/java/java_polymorphism.htm Polymorphism is the ability of an object to take on many forms. The most common use of polymorphism in OOP occurs when a转载 2010-03-30 10:38:00 · 467 阅读 · 0 评论 -
java单例讲解
Singleton For those who havent heard of design patterns before, or who are familiar with the term but not its meaning, a design pattern is a template for software development. The转载 2010-03-30 11:18:00 · 376 阅读 · 0 评论