adapting java api classes
a) Implement a subclass Square that extends the Rectangle class. In the constructor accept the x and y positions of the centre and the side length of the square. (Use the setLocation and setSize methods of the Rectangle class from the Java API).
b) Supply a method getArea that computes and returns the area of the square.
c) Write a test harness that creates a new Square object and then prints out its details using the toString method that has been inherited from the Retangle class.
d) Also print out the area of the Square.
[543 byte] By [
Mrnewbie] at [2007-11-11 7:00:19]

# 1 Re: adapting java api classes
Hi Mrnewbie,
The specifications look good, what do you want us to do for you now? We would be glad to see your progress on this assignment and help you if you have an issues.
-----
Naveen Vooka
www.devsquare.com
DevSquare - Online Application Development