首页 > 编程语言 > 详细

Java中的blank final

时间:2015-04-28 11:02:39      阅读:257      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!