Must explicitly invoke another constructor

后端 未结 6 1123
借酒劲吻你
借酒劲吻你 2021-01-25 03:27

Why is Eclipse keeps giving me error on the constructor:

 public DenseBoard(Tile t[][]){
      Board myBoard = new DenseBoard(t.length, t[0].length);
  }
         


        
6条回答
  •  我在风中等你
    2021-01-25 03:48

    You can just do this to send the values up to parent class.

    public DenseBoard(Tile t[][]){
          super(t.length, t[0].length);
     }
    

提交回复
热议问题