Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA Define an abstract class called Shape which has the X and Y coordinates of the centar of the shape as attributes. This class should

JAVA

Define an abstract class called Shape which has the X and Y coordinates of the centar of the shape as attributes. This class should be defined to enable the initialisation of both attributes and should encapsulate the attributes with access methods.

Write a class called Circle that inherits from the class Shape. A circle should be initialised with all the attributes of the Shape class and have an attribute for the radius. It should be possible to create a circle without specifying the radius, in which case the radius will default to 1.0.

Write a program that creates 3 Circles and displays the attributes of each.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual Basic 2008 Comprehensive Concepts And Techniques

Authors: Gary B. Shelly, Corinne Hoisington

1st Edition

1423927168, 978-1423927167

More Books

Students also viewed these Databases questions