Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Help extending Shape class with Circle and Rectangle classes

807598Oct 30 2006 — edited Nov 1 2006
I am a little confused about what I need to do here. I created four separate classes (Circle, Rectangle, Square, and Triangle) that each calculate their own area and perimeter via user input.

Now I have to extend the Shape class with Circle and Rectangle classes, first. Then, I have to extend Rectangle with Square and Triangle classes.

Was I supposed to calculate the area and perimeter of the four shapes in the Shape class, or did I do it right? What should be in the Shape class?

How do I extend the things above? I know you have to write public class Circle extends Shape, but do I have to put anything else in the body of the class for Shape?

Sorry about all the questions, but I am so confused about what I have to do. If anybody can help me, it would be greatly appreciated, and thanks in advance!

If you need to see code, let me know!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 29 2006
Added on Oct 30 2006
30 comments
7,554 views