Rathod Nilam
please help me to find ans of this question,

Define the Rectangle class that contains:
Two double fields x and y that specify the center of the rectangle, the data field
width and height ,
A no-arg constructor that creates the default rectangle with (0,0) for (x,y) and 1
for both width and height.
A parameterized constructor creates a rectangle with the specified x,y,height
and width.
A method getArea() that returns the area of the rectangle.
A method getPerimeter() that returns the perimeter of the rectangle.
A method contains(double x, double y) that returns true if the specified point
(x,y) is inside this rectangle.
Write a test program that creates two rectangle objects. One with default values
and other with user specified values. Test all the methods of the class for both
the objects.
Like · Comment ·

Bhuro Patel

Its so simple task to write a class as you described above. Where do you stuck?
Like · 1 ·

Rathod Nilam

thank you jaydip.......
Like ·
Download Android App