8 pictures to understand Java

8 pictures to understand Java

A picture is worth a thousand words, and the following diagrams are from the Java tutorials on Program Creek, which currently have the most votes. If the diagram doesn't explain the problem, then you can use its title to get a glimpse of it.

1. String immutability

The following image shows what this code does.

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

2. The difference between the equals() method and the hashCode() method

HashCode is designed to improve performance. The difference between the equals() method and the hashCode() method is:

  1. If two objects are equal, then they must have the same hash value.
  2. If two objects have the same hash value, they are not necessarily equal.

3. Hierarchy of Java exception classes

The red parts in the figure are checked exceptions. They must be caught or declared as thrown in the function.

4. Hierarchy of collection classes

Note the difference between Collections and Collection. (Collections contain various static polymorphic methods related to collection operations)

#p#

5. Java synchronization

Java synchronization mechanism can be explained by the analogy of a building.

6. Aliases

Aliases mean that there are multiple variables pointing to the same memory block that can be updated, and these aliases are different object types.

7. Heap and Stack

The diagram shows where methods and objects are located in memory at runtime.

8. Java virtual machine runtime data area

The diagram shows the entire virtual machine runtime data area.

Original link: programcreek
Translation link: http://www.importnew.com/11725.html

<<:  2015 Android Development New Technology

>>:  Can you write high-quality Objective-C code?

Recommend

Families, please type "Protect Human Relatives" on the public screen

Produced by: Science Popularization China Produce...

Low-key Ganzi, Sichuan, contains such a unique color aesthetics

Ganzi, Sichuan A very humble name It encompasses ...

With the "woolly mammoth rat", can we really "revive the mammoth"?

On March 4, the US biotechnology company Colossal...

What does bidding mainly do and what do bidding promoters need to do every day?

Many companies are recruiting SEM bidders, and ma...

The film law is here! Is the rating system far behind?

From its drafting in 2003 to its first review by ...

To do word-of-mouth marketing well, these 5 "T"s are essential

In today's Internet age where everyone is a s...

These ten IT jobs are the easiest. Where do you rank?

When people mention IT professions, the first thi...

How to follow hot spots? Here are 4 correct steps for you

“Chasing hot spots” is certainly not unfamiliar t...

Case | Super practical account optimization strategy for the decoration industry

This article shares with you the super practical ...

How to operate a WeChat public account from scratch?

Post an article once, lose followers once This is...