Schematic Java mechanism

Source: Internet
Author: User

A picture is worth tens of thousands of words! I hope this article will help children to review the knowledge they already know.

immutable properties of 1String objects

Shows the procedure for running the following code:

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

2equals () and Hashcode () method Collaboration Conventions

Hashcode (hash coding, hash code) is designed to lift high performance.

The relationship between Equals () and the Hashcode () method can be summarized as:

A. If two objects are equal (equal), then you must have the same hash code (hash code)

B. Even if two objects have the same hash value (hash code), they are not necessarily equal.

3Java Exception class hierarchy

The pink is the checked exception (checked exceptions), which must be captured by the Try{}catch statement block or declared in the method signature through the throws clause.

Another type of exception is the runtime exception (runtime exceptions), which requires the programmer to analyze the code to determine whether it is captured and processed.

When declared as error, it is a serious error and requires special handling based on business information, and error does not need to be captured.

4 Collection Class hierarchy relationships

Note the difference between the collections (tool Class) and the Collection (collection top-level Interface):

5 Lock--java The basic idea of synchronization

The Java Synchronization (synchronization) mechanism can be likened to a building:

6Java Object reference processing mechanism

Aliases refer to multiple references pointing to the same memory address (the object's actual address, which can be understood to be an object), and even the types of these references are completely different.

7 Memory structure of Java objects in the heap

Shows the site where methods and objects are in memory at run time

In the vast majority of cases:

Objects (and their domains) are stored inside the heap, while the parameters of the method, local variables (references, and 6 basic types) are stored inside the stack.

Of course, in very special cases (extreme optimizations [object stack], constant pool [String], static variable [method area], etc.) will also break this unspoken rule.

8JVM Run-time data area

Shows the data partitioning of the JVM (Java Virtual machine) runtime population

I do not know that some of the Java learning materials and some video teaching sense is not interested in, I have some of these things, if interested can stay Q, or private chat me, I send you, learn from each other.

Schematic Java mechanism

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.