the blank final field factors may not have been initialized

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....

posted @ 2018-05-21 11:51  danieldai  阅读(638)  评论(0)    收藏  举报