Correct use of transient, volatile and final modifiers

transient As we all know, as long as an object implements the Serializable interface, the object can be serialized in two ways: - implement Serializable (automatic serialization) - implement Externalizable (there is no automatic serialization, you need to specify so and so serialization yourself. See the following case for specific use)    A ...

Added by PowersWithin on Tue, 08 Mar 2022 02:05:46 +0200

Singleton mode and Volatile learning

Singleton mode and Volatile learning Beep beep link: https://www.bilibili.com/video/BV15b4y117RJ?p=56 requirement Master the implementation methods of five singleton modesUnderstand why you should use volatile to modify static variables when implementing DCL (double check lock)Understand the scenario of using singleton in jdk 1, Five implem ...

Added by tcl4p on Thu, 27 Jan 2022 01:09:46 +0200