????????final????????????????????????int???????????????????????дfinal????????????????????????????????????????

????1???????????????final??????????????д???????????????????????????????????????????????????????????????????????

????????????????????????????????A???writerOne()???????????????B???writerTwo()???????????????C???reader ()????????????????????????????

??????????У?1???final???д??2??????final????????????????д??3???????????????????????????????????????????????1?????3????????2??3???????????

????JMM????????????C?????????д???A????????ж?final?????????????д????C??????????????±?0????1????д???B??????????д???????C??????????????????????JMM????????B??д???????C????????д???B??????C??????????????????????н??????????

??????????????????C????д???B??????????д??д???B??????C???????????????lock??volatile???????????????

???????final???ò???????????“???”

?????????????????дfinal????????????????????????????????????????????????????????????final?????????????б????????????????????????Ч?????????????????????????????????????????????????????????????????????????ò????????????“???”?????????????????????????????????

public class FinalReferenceEscapeExample {
final int i;
static FinalReferenceEscapeExample obj;

public FinalReferenceEscapeExample () {
    i = 1;                              //1дfinal??
    obj = this;                          //2 this???????“???”
}

public static void writer() {
    new FinalReferenceEscapeExample ();
}

public static void reader {
    if (obj != null) {                     //3
        int temp = obj.i;                 //4
    }
}
}