当前位置:网站首页>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)
边栏推荐
- Talking about acid of database
- Brief description of software testing and software maintenance
- 你不知道的stringstream的用法
- Mapbox loads nationwide and provincial range, displaying multi-color animation points, migration lines, 3D histogram, etc
- Void* pointer
- 20211115 any n-order square matrix is similar to triangular matrix (upper triangle or lower triangle)
- 消息中间件
- Map 23 summary
- Simulink variant model and variant subsystem usage
- 20211020 段院士全驱系统
猜你喜欢

20211104 为什么相似矩阵的迹相同

Uni app essay

Top+jstack to analyze the causes of excessive CPU

Message Oriented Middleware

【安全】零基礎如何從0到1逆襲成為安全工程師

Screenshot of cesium implementation scenario

Mttr/mttf/mtbf diagram

Tutorial (5.0) 03 Security policy * fortiedr * Fortinet network security expert NSE 5

torch. How to calculate addmm (m, mat1, mat2)

Some websites of QT (software download, help documents, etc.)
随机推荐
Mttr/mttf/mtbf diagram
MySQL startup error: innodb: operating system error number 13 in a file operation
Four kinds of hooks in deep learning
CAS无锁
20211020 段院士全驱系统
transforms. ColorJitter(0.3, 0, 0, 0)
20211028 adjustment and tracking
[security] how to counter attack from 0 to 1 to become a security engineer with zero Foundation
Uni app subcontracting loading and optimization
Can I open an account for the reverse repurchase of treasury bonds? Can I directly open the security of securities companies on the app for the reverse repurchase of treasury bonds? How can I open an
12. constructor explanation, explicit, initialization list
【安全】零基礎如何從0到1逆襲成為安全工程師
JUC原子引用与ABA问题
20220524 如何把CoppeliaSim安装到D盘
网上开户安全吗?新手可以开账户吗?
Some websites of QT (software download, help documents, etc.)
Neo4j Environment Building
[network security] webshell empowerment of new thinking of SQL injection
System analysis - detailed description
Tutorial (5.0) 02 Management * fortiedr * Fortinet network security expert NSE 5