Java 基础
1. equals() and hasCode()
(1). If two objects are equal, then they must have the same hash code.
(2). If two objects have the same hashcode, they may or may not be equal.
2.Exception Hierarchy in Java - Diagram
Red colored are checked exceptions. Any checked exceptions that may be thrown in a method must either be caught or declared in the method’s throws clause. Checked exceptions must be caught at compile time.Checked exceptions are so called because both the Java compiler and the Java virtual machine check to make sure this rule is obeyed.

本文探讨了Java中equals()与hashCode()方法的关系,并介绍了Java异常体系结构,包括已检查异常的概念及如何在方法中声明或捕获这些异常。
16万+

被折叠的 条评论
为什么被折叠?



