static :我们都知道被static 修饰的变量都是静态变量,对于静态变量在JVM中存在于常量池中,常量池一般在perm heap 中. 对于static 变量的初始化是在类构造器clinit中。
public class A { public String name="peter"; public static final int age=100; public static int salary = 10000; static { System.out.println("init static block"); } }
public class Test { public static void main(String[] args) { // System.out.println(A.age); System.out.println(A.salary); } } result : init static block 10000
final static :被final修饰的变量一旦初始化其值或引用都不能修改,final static基本类型的变量的初始化是在类初始化的准备阶段。引用类型的变量初始化也是在类构造器clinit中
public class Test { public static void main(String[] args) { System.out.println(A.age); // System.out.println(A.salary); } } result : 100
相关推荐
Difference between HBase and RDBMS
state 50 differences between marketing and sales
What's the difference between TAF and FCF
FX2 and FX2LP 系列的区别 cy7c68013A开发套餐
Difference Between VMWare ESX and VMWare ESXi
java and C++ difference
Summary: <br/>Symptom: This is an explanation of differences between TYPE and LIKE additions <br/>Additional key words: Data types, data objects, ABAP type concept, Dictionary ...
IE和Firefox下开发时会遇到的问题
What's the Difference between Pneumatic, Hydraulic, and Electrical Actuators.docx
1、Explain the difference between internal and external fragmentation. 2、Given five memory partitions of 100 KB, 500 KB, 200 KB, 300 KB, and 600KB (in order), how would each of the first-fit, best-...
等效采样示波器与实时采样示波器区别
易趣网买家和卖家解决在线争端的不同方式,董宝田,李玮,有关在线争端解决的研究开始于二十世纪末期,现如今,随着电子商务爆发式的发展,怎样解决在线争端变得尤为重要。作为全球最大的网上
很好的东西,简述PLMN和PSTN的区别,大家看看就知道了。
N-磷酰化多肽的质子加合峰与钠离子加合峰的多级质谱裂解规律的差异性研究,刘艳,陈培燕,利用三种不同的磷酰化试剂,分别对胸腺肽的肌动蛋白结合域进行N-磷酰化修饰,并通过ESI-MS/MS对其进行序列测定。...
Time Dependent Problems and Difference Methods addresses these various industrial considerations in a pragmatic and detailed manner, giving special attention to time dependent problems in its ...
sva classical q&a Qi1)What is callback ? (Qi2)What is factory pattern ?...(Qi3)Explain the difference between data types logic and reg and wire . (Qi4)What is the need of clocking blocks ?
Finite Difference Schemes and Partial Differential Equations
Data collection at ultra high-frequency on ... Overall the difference in the coefficients is bigger between the dirty series and the clean series than among series filtered with different algorithms.
《通信网基本概念及其主体结构》一书 (第二版)课后练习答案。主要是问答和简述以及设计题的解答。
The difference between the smaller, downloadable .Net Framework and the full desktop version is one of the major disparities between the two platforms. In addition, the fact that Silverlight is ...