Where did I go wrong?
import java.util.Scanner; abstract class Shape { int width; abstract void area(); } class Square extends Shape{ public void area(int width){ area = width*width; System.out.println(area); } } class Circle extends Shape{ public void area(int width){ area = Math.PI*(width*width); System.out.println(area); } } public class Program { public static void main(String[ ] args) { Scanner sc = new Scanner(System.in); int x = sc.nextInt(); int y = sc.nextInt(); Shape a = new Square(x); Shape b = new Circle(y); a.area(); b.area(); } } Output (to be) Sample Input: 5 2 Sample Output: 25 12.566370614359172