via: http://www.programcreek.com/2013/09/top-8-diagrams-for-understanding-java/

 

1. String Immutability

The following diagram shows what happens for the following code:

String s = "abcd";

s = s.concat("ef");

Java_Top 8 Diagrams for Understanding Java_java


 2. The equals() and hashCode() Contract

HashCode is designed to improve performance. The contract between equals() and hasCode() is that:

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.

Java_Top 8 Diagrams for Understanding Java_java_02


 3. Java Exception Class HierarchyRed colored are checked exceptions which must either be caught or declared in the method’s throws clause.

Java_Top 8 Diagrams for Understanding Java_JVM_03

4. Collections Class Hierarchy

Note the difference between Collections and Collection.

Java_Top 8 Diagrams for Understanding Java_java_04


 

Java_Top 8 Diagrams for Understanding Java_java_05

5. Java synchronization

Java synchronization mechanism can be illustrated by an analogy to a building.

Java_Top 8 Diagrams for Understanding Java_Java_06


 6. AliasingAliasing means there are multiple aliases to a location that can be updated, and these aliases have different types.

Java_Top 8 Diagrams for Understanding Java_java_07


 7. Stack and HeapThis diagram shows where methods and objects are in run-time memory.

Java_Top 8 Diagrams for Understanding Java_JVM_08


 8. JVM Run-Time Data AreasThis diagram shows overall JVM run-time data areas.

Java_Top 8 Diagrams for Understanding Java_java_09



  • Java_Top 8 Diagrams for Understanding Java_java_10

  • 大小: 25 KB
  • Java_Top 8 Diagrams for Understanding Java_JVM_11

  • 大小: 22.4 KB
  • Java_Top 8 Diagrams for Understanding Java_java_12

  • 大小: 126.3 KB
  • Java_Top 8 Diagrams for Understanding Java_JVM_13

  • 大小: 27.5 KB
  • Java_Top 8 Diagrams for Understanding Java_JVM_14

  • 大小: 46 KB
  • Java_Top 8 Diagrams for Understanding Java_Java_15

  • 大小: 11.7 KB
  • Java_Top 8 Diagrams for Understanding Java_JVM_16

  • 大小: 3.7 KB
  • Java_Top 8 Diagrams for Understanding Java_Java_17

  • 大小: 13.8 KB
  • Java_Top 8 Diagrams for Understanding Java_java_18

  • 大小: 25.9 KB
  • 查看图片附件