当前位置:网站首页>Final principle
Final principle
2022-06-13 09:05:00 【Q z1997】
Set up final The principle of variable
I understand volatile principle , Another comparison final The implementation of is relatively simple
public class TestFinal {
final int a = 20;
}
Bytecode
0: aload_0
1: invokespecial #1 // Method java/lang/Object."<init>":()V
4: aload_0
5: bipush 20
7: putfield #2 // Field a:I
<-- Write barriers
10: return
Find out final The assignment of variables will also pass putfield Order to complete , Similarly, a write barrier will be added after this instruction , Ensure that when other threads read its value, it will not appear as 0 The situation of
obtain final The principle of variable
No use final ( lower than short)
Use final( lower than short)
Add final Use constant pools ( higher than short)
No addition final Use constant pools ( higher than short)
边栏推荐
- 基于微信小程序的图书馆管理系统.rar(论文+源码)
- Some websites of QT (software download, help documents, etc.)
- Detailed explanation of C language callback function
- Drill down to protobuf - Introduction
- final 原理
- JUC Unsafe
- Cmake Learning Series I
- ""? "& in URL Role of "" sign
- 20211108 is transpose multiply a a a positive definite matrix? What are the necessary and sufficient conditions for a to be a positive definite matrix?
- Map 23 summary
猜你喜欢
20211020 段院士全驱系统
[network security penetration] if you don't understand CSRF? This article gives you a thorough grasp
Tutorial (5.0) 03 Security policy * fortiedr * Fortinet network security expert NSE 5
Uni app subcontracting loading and optimization
Animation through svg
Tutorial (5.0) 02 Management * fortiedr * Fortinet network security expert NSE 5
20220606 Young's inequality for Matrices
JUC 原子累加器 源码之 LongAdder
final 原理
Completely uninstall PostgreSQL under Linux
随机推荐
pytorch统计模型的参数个数
Map 23 summary
Brief description of port, domain communication port and domain service
What are the bank financial products? How long is the liquidation period?
Simulink如何添加模块到Library Browser
JUC原子引用与ABA问题
Three indexes reflecting system reliability in performance test: MTTF, MTTR and MTBF
Vscode plug in
20211104 为什么矩阵的迹等于特征值之和,为什么矩阵的行列式等于特征值之积
Four kinds of hooks in deep learning
Judgment of single exclamation point and double exclamation point in JS
How excel adds hyperlinks to some text in a cell
Tutorial (5.0) 04 Fortint cloud services and scripts * fortiedr * Fortinet network security expert NSE 5
20211104 why are the traces of similar matrices the same
Web page H5 wechat sharing
Tutorial (5.0) 02 Management * fortiedr * Fortinet network security expert NSE 5
Summary of the first retrospective meeting
Some websites of QT (software download, help documents, etc.)
Subspace of 20211004 matrix
20211108 A转置乘A是正定矩阵吗?A转置乘A是正定矩阵的充分必要条件是什么?