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

前端 未结 4 814
一生所求
一生所求 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:12

    If you don't specify any default constructor then at the compile time it will give you this error "constructor in class cannot be applied to given type;" Note: If you created any parameterized constructor.

提交回复
热议问题