码迷,mamicode.com
首页 > 编程语言 > 详细

Java中的blank final

时间:2015-04-28 11:03:33      阅读:206      评论:0      收藏:0      [点我收藏+]

标签:

Java allows the creation of blank finals, which are fields that are declared as final but are not given an initialization value.

In all case, the blank final must be initialized before it is used, and the compilers ensures this. However, blank finals provide much more

flexibility in the use of the final key word.

since, for example, a final field inside a class can now be different for each object, and yet it retains its immutable quality.

Blank finals must be initialized in the constructor

Java中的blank final

标签:

原文地址:http://www.cnblogs.com/hustxujinkang/p/4462099.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!