Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

can someone tell me why it wont work

–1 vote
asked Feb 18, 2020 by ic_ a.d (110 points)

4 Answers

0 votes
answered Feb 18, 2020 by anonymous
you must have to import java.util.*; package in order to use graphics......
0 votes
answered Feb 19, 2020 by Theodore Friedrich (290 points)
You named your shape file just "Shape." Rename it to "Shape.java" so it runs as java code and not as plain text.
+1 vote
answered Feb 21, 2020 by zemiak (550 points)

Rename tab/file Shape to Shape.java
Move class Rectangle to file Rectangle.java

Each public class must be in file with same name as this public class.

0 votes
answered Aug 30, 2020 by Prerna Arora (140 points)
Rename your shape file with Shape.java.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...