can someone tell me why it wont work

–2 votes

4 Answers

0 votes
answered Feb 18 by anonymous
you must have to import java.util.*; package in order to use graphics......
0 votes
answered Feb 19 by Theodore Friedrich (320 points)
You named your shape file just "Shape." Rename it to "Shape.java" so it runs as java code and not as plain text.
0 votes
answered Feb 21 by zemiak (430 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 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.
...