-5

I trying to run this code but I am getting stuck as to why the constructor is not working.

class Timber{

    String item_Name;
    int length;
    int width;
    String sku;
    
    public Timber(String name, int L, int W, String iSku){
        item_Name = name;
        length = L;
        width = W;
        sku = iSku;
    }
    
}


class Main extends Timber{

    public static void main(String[] args) {

        Timber small = new Timber("2 by 4", 2, 4, "1010");

        System.out.println(small.length);
        
    }

}
PM 77-1
  • 12,933
  • 21
  • 68
  • 111

1 Answers1

-1

Just add a default constructor in your Timber class.

public Timber() {}
Steven Diamante
  • 207
  • 2
  • 7