Java-8 most popular images for understanding the Java mechanism and 8 images for Java

Source: Internet
Author: User

Java-8 most popular images for understanding the Java mechanism and 8 images for Java

The world is always better than ten million words!

The following eight figures are from the Java tutorial of Program Creek. Currently, this is the most popular article on this website.
I hope this article will help you review the knowledge you already know. If the picture is not clear enough, you may need to read a detailed article or search for it.

1. unchangeable features of String objects

(For details, click the title above)

The following code execution process is displayed:

String s = "abcd";  s = s.concat("ef");  

For more information, see Java String.
 

 

2. equals () and hashCode () method collaboration conventions

HashCode is designed to improve performance.
The relationship between equals () and hashCode () methods can be summarized as follows:
2.1 If the two objects are equal (equal), they must have the same hash code)
2.2 even if two objects have the same hash code, they are not necessarily equal.
Chinese Reference: implementation principle of HashMap
 


 

3. Java exception class hierarchy
The pink ones are checked exceptions, which must be captured by the try {} catch Block or declared by the throws clause in the method signature.
Another type of exception is runtime exceptions. The programmer needs to analyze the code to determine whether to capture and process the exception.
If it is declared as Error, it is a serious Error and must be specially processed based on the business information. The Error does not need to be captured.
Chinese example: Exception



4. hierarchical relationship of collection classes
Note the differences between Collections and Collection:
Chinese Reference: Collections

 


5. Lock-the basic idea of Java synchronization
Java synchronization mechanism can be compared with a building:
Chinese Reference: thread synchronization --- synchronized
 



6. Java object reference Processing Mechanism
An alias refers to multiple references pointing to the same memory address (the actual address of the object, which can be understood as an object). Even these references are of different types.
 


7. Memory Structure of Java objects in the heap
Displays the memory Chinese method and the location of the object during runtime.
In most cases, objects (and their attribute fields) are stored in the heap, while method parameters, local variables (references, and six basic types) are stored in the stack.
Of course, this potential rule will be broken in very special circumstances (extreme Optimization of [object into Stack], constant pool [String], static variable [method Zone], and so on.
 

8. JVM runtime data Zone
Displays the overall Data Partition during JVM (Java Virtual Machine) running.
 

Java study and exchange QQ group: 523047986 chat prohibited, do not enter!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.