Why I need Construct of subclass...Even there's no use of it...
import java.util.Scanner; class Rectangle { double a,b; Rectangle(double a, double b) { this.a = a; this.b = b; } double areaS() { double areaS = a*b; return areaS; } } public class Volume extends Rectangle { Volume(double a, double b) { super(a, b); // TODO Auto-generated constructor stub } public static void main(String [] args) { double c,d; try(Scanner input = new Scanner(System.in)) { System.out.println("Enter the length: "); c = input.nextDouble(); System.out.println("Enter the width: "); d = input.nextDouble(); } Rectangle area = new Rectangle(c,d); System.out.print("Area on a rectangle : "+area.areaS()); } } https://code.sololearn.com/cRA792WEkI6m/?ref=app