Field xxx is never assigned to, and will always have its default value null

前端 未结 4 1292
南方客
南方客 2020-12-17 18:26

Anyone know whats this problem?

I got this warning Field xxx is never assigned to, and will always have its default value null on private sta

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-17 19:23

    The compiler is warning you that quantit is never initialized and will always be null.

    You probably should initialize it with an instance of a class that derives from ImageManipulation.Quantizer (you cannot instantiate Quantizer itself because it's an abstract class):

    private static Quantizer quantit = new QuantizerImplementation();
    

提交回复
热议问题