“Constructor cannot be applied to given types” when constructors have inheritance

前端 未结 4 799
一生所求
一生所求 2020-12-19 04:07

This is my base class:

abstract public class CPU extends GameObject {
    protected float shiftX;
    protected float shiftY;

    public CPU(float x, float          


        
4条回答
  •  再見小時候
    2020-12-19 04:39

    As the error is trying to tell you, you need to pass parameters to your base class' constructor.

    Add super(x, y);

提交回复
热议问题