Calling superclass from a subclass constructor in Java
I am trying to create a constructor that takes a field as a parameter, then puts it in a field that is stored in a superclass. Here is the code I am using public crisps(String flavour, int quantity) { this.flavour = super.getFlavour(); this.quantity = quantity; } In the superclass I have initialised the field with private String flavour; and I have an accessor method public String getFlavour() { return flavour; } I am getting an error " flavour has private access in the superclass ", but I believe this shouldn't matter as I am calling the accessor method that returns it to the field? What you