title: how to define parameterized constructor of abstract class in child class in java
body: <p>how to define parameterized constructor of abstract class in child class in java</p>
  
  <pre><code>abstract class Car {
      protected boolean isSedan;
      protected String seats;
  
      public Car(boolean isSedan, String seats) {
          this.isSedan = isSedan;
          this.seats = seats;
      }
  
      public boolean getIsSedan() {
          return this.isSedan;
      }
  
      public String getSeats() {
          return this.seats;
      }
  
      abstract public String getMileage();
  }
  
  public class WagonR extends Car{
      protected int mileage;
      protected boolean isSedan;
  
      public WagonR(int mileage) {
          super(isSedan,seats); 
          this.mileage=mileage;
      }   
  }
  
  public class Solution {
  
      public static void main(String[] args) throws IOException {
          BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
          int carType = Integer.parseInt(bufferedReader.readLine().trim());
          int carMileage = Integer.parseInt(bufferedReader.readLine().trim());
  
          Car wagonR = new WagonR(carMileage);
          wagonR.printCar("WagonR");
      }
  }
  </code></pre>
  
  <p>While passing isSedan and seats parameters in super block in WagonR constructor, getting compilation error "Cannot refer to an instance field isSedan while explicitly invoking a constructor" and "Cannot refer to an instance field seats while explicitly invoking a constructor"
  <strong>Constraint is while execution only one parameter will be passed like WagonR(carMileage).</strong></p>