Abstract class called Shape bullet declare member variables

Abstract class called \"Shape\" bullet declare member variables \"width\" of type double \"height\" of type double bullet declare and implement a method called \"setSize\" 2 parameters:   \" width\",    \"height\"    of    type    double This method sets the member variables width and height bullet declare an abstract method called \"getArea\" The return type of this method should be double

Solution

public asbtract Shape

{

//declaring variables

double width;

double height;

//This method sets the member variables width and height

public setSize(double width, double height)

{

this.width=width;

this.height=height;

}

//declaring abstract method

public abstract double getArea();

}

________thank you

 Abstract class called \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site