一.先说说Java中equals和==的区别: Java中的数据类型,可分为两类: 1.基本数据类型(也叫原始数据类型) 八大基本数据类型 char byte short int long double float boolean 2.引用数据类型(也就复合数据类型)除了上面的8个,其他都是引用数据类型 区别: 基本数据类型比较只能用==,不能用equals,因为用equals(参数),参数必须为对象. 他们之间的比较,比较的是他们的值. public class Test { public s…
本文参考 本篇文章参考自<Effective Java>第三版第十条"Obey the general contract when overriding equals" the conditions when each instance of the class is equal only to itself Each instance of the class is inherently unique -- 类的每一个实例本就彼此不同,例如Thread类,每一个线程仅和自…
References: [1] http://tutorials.jenkov.com/java-date-time/index.html [2] https://docs.oracle.com/javase/tutorial/datetime/iso/period.html 1. Java 8 and Java 7 Date classes The main change in the Java 8 date time API is that date and time is now no l…