8 pictures to give you a deeper understanding of Java__java

Source: Internet
Author: User

Sometimes a picture is more than words. The following figure is a Java tutorial from Program Creek, the most popular article so far. I hope these graphs can help you to review the knowledge you have learned. If you can't figure out the problem through these graphs, you may want to read the detailed articles to further learn Java


1, the invariance of the string (http://www.9ymw.com/high-quality code download)


The following illustration shows a code run procedure as follows:


String s = "ABCD"; s = S.concat ("EF");



Note: String reference variable: String reference Variable String object: String objects


2, Equals () and hashcode () of the relationship (http://www.9ymw.com/high-quality code download)


Hash codes are designed to improve performance. The relationship between Equals () and Hashcode () is:


2.1 If two objects are equal, they must have the same hash code.

2.2 Even if two objects have the same hash code, they are not necessarily equal.



Note: hash function: Hash functions buckets: hash bucket

3, the Java Exception class hierarchy (http://www.9ymw.com/high-quality code download)


A red-colored box is a check exception that must be thrown by capturing an exception in a Try-catch code block or by Thorws in a method.




4, the collection class hierarchy (http://www.9ymw.com/high-quality code download)


Note the difference between collections and collection:



Note: Collection: is the top-level interface of the collection class hierarchy.

Collecitons: This class consists of static methods and collection objects that manipulate the collection object.




5, Java Synchronization mechanism (http://www.9ymw.com/high-quality code download)


The Java synchronization mechanism can be illustrated by a building:


Note: Special room: Special Room wait room: Waiting room Hallway: Corridor


6, the reference alias mechanism (http://www.9ymw.com/high-quality code download)


The reference alias mechanism means that multiple references can be positioned to the same memory address that can be updated, and these reference variables can be of different types.




7, Stack and heap (http://www.9ymw.com/high-quality code download)


The following figure shows where the methods and objects are stored in memory at run time



Note: stack: Stack Heap: Heap


8, Java Virtual run-time data region (http://www.9ymw.com/high-quality code download)


The following figure shows the data region of the Java Virtual Runtime population




Note: Thread: Threads PC Register: Program counter JVM stack:java virtual machine stack

Native method Stack: Local methods Stack Heap: Heap Approach Area: Methods zone: Runtime Constant pool: Run a constant-time pool (http://www.9ymw.com/high quality code download)

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.