码迷,mamicode.com
首页 > 其他好文 > 详细

the blank final field factors may not have been initialized

时间:2018-05-21 14:52:10      阅读:1116      评论:0      收藏:0      [点我收藏+]

标签:security   change   ref   erro   pil   use   because   zed   Fix   

技术分享图片

Q1: why we should initialize final field before completion of new instance?

  final means no changeable in java enviroment, the java compiler urges us follow the security violation.

Q2: how to resolve the error above?

  actually, it is because factors perhaps refer to passed parameter.

     so , keeping a good habit to add the prefix ‘this.‘ is good manner to resolve the error.

  this.factors = Arrays.copyof....

the blank final field factors may not have been initialized

标签:security   change   ref   erro   pil   use   because   zed   Fix   

原文地址:https://www.cnblogs.com/daniel123/p/9066487.html

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