Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Suppose that you have the following class definitions: [O2] [4 Marks] public class Shape { private int point; private String color; public Shape(int a, String

Suppose that you have the following class definitions: [O2] [4 Marks]

public class Shape

{

private int point;

private String color;

public Shape(int a, String g)

{

point = a;

color = g;

}

public void display()

{

System.out.println(point);

System.out.println(color);

}

}

public class Circle extends Shape

{

private double radius;

public Circle(int i, String j, double r)

{

//Postcondition: point=i,color=j,radius=r

}

public void show()

{

//Output the values of point,color and radius

}

}

a. Write the definition of the constructor Circle [2 marks]

b. Write the definition of the method show [2 marks]

java

help me please now

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

The Database Relational Model A Retrospective Review And Analysis

Authors: C. J. Date

1st Edition

0201612941, 978-0201612943

Students also viewed these Databases questions

Question

3. What are potential solutions?

Answered: 1 week ago

Question

4. I can tell when team members dont mean what they say.

Answered: 1 week ago