Java blank final, javafinal
Java 1.1 allows us to create "blank final", which belongs to some special fields. Although declared as final, no initial value is obtained.
In either case, Blank final MUST be correctly initialized before actual use (Blank finals MUST be initialized in the constructor :). Moreover, the compiler will take the initiative to ensure that this provision is implemented.
However, blank final has the maximum flexibility for various final keyword applications.
For example, a final field inside the class can be different for each object, while still keeping its "unchanged" nature. The following is an example:
/*** Created by xfyou on 2016/11/2. * blank final demo */public class BlankFinal {private final int I = 0; private final int j; private final Poppet p; public BlankFinal () {j = 1; p = new Poppet ();} public BlankFinal (int j) {this. j = j; p = new Poppet ();} public static void main (String [] args) {BlankFinal bf = new BlankFinal () ;}} class Poppet {}