Third test is error. I don't know why. Lesson 56. Project figures.
import java.util.Scanner; abstract class Shape { private int width; abstract void area(); public int getWidth(){ return width;} Shape(int x){ width=x; } } class Square extends Shape{ Square(int x){ super(x); } void area(){ System.out.println((int)Math.pow(getWidth(),2)); } } //введите код сюда class Circle extends Shape{ Circle(int x){ super(x); } void area(){ System.out.println(Math.PI*Math.pow(getWidth(),2)); } } public class Program { public static void main(String[ ] args) { Scanner sc = new Scanner(System.in); int x = sc.nextInt(); int y = sc.nextInt(); Square a = new Square(x); Circle b = new Circle(y); a.area(); b.area(); } }