Where did I go wrong? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Where did I go wrong?

import java.util.Scanner; abstract class Shape { int width; abstract void area(); } //your code goes here class Square extends Shape { Square (int x) { width = x; } public void area() { System.out.println(width*width); } } 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(); } } And what does the error mean?

30th May 2021, 11:20 PM
Name
Name - avatar
2 Answers
+ 2
missing the Circle class declaration/code ^^
30th May 2021, 11:21 PM
visph
visph - avatar
0
Ahh.. Thanks visph
30th May 2021, 11:23 PM
Name
Name - avatar