--3.1 immutable ADT software configuration and snapshot

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/lll_90/article/details/93417574

Note that the order of binding
Double A = (Double) 2/3; ... // A = 0.6666
the Data variable data type, LocalDataTime data type is immutable

Variable assignment change point is variable, point to different values.
When the contents of the variable variable, in changing the internal contents of the variable reference.
So has changed variables reference and change of the difference between the value of the variable.
For when String is immutable types, assignment, paid assigned a reference, not value. That is to change the reference value does not change.
For the StringBuilder append () operation to change the variable value.

And, the modified final is immutable reference. For immutable type, it points a reference immutable, then the value of a variable represents not; mutable, immutable, even if a reference point, but does not affect the value of the variable changes.
Meanwhile, final keyword immutable references provides support for static checking

Snapshot Diagram
original data type
Here Insert Picture Descriptionobjects
Here Insert Picture Description
for the object type of the variable, with a single frame; for immutable type double frame
Here Insert Picture Descriptionfor immutable reference bidirectional arrows
such as, in the Person ID Final;
Here Insert Picture DescriptionList <>
Here Insert Picture Descriptionthe Set <>
Here Insert Picture Descriptionthe Map <>
Here Insert Picture Description
Special , the iterator snapshot
Here Insert Picture Description

Guess you like

Origin blog.csdn.net/lll_90/article/details/93417574