-
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.
-
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
Similar Threads
-
Replies: 2
Last Post: 06-14-2006, 03:16 PM
-
Replies: 1
Last Post: 05-13-2005, 06:46 AM
-
By Mr. Spock in forum VB Classic
Replies: 0
Last Post: 08-24-2000, 12:34 PM
-
By Sreedhar V in forum ASP.NET
Replies: 0
Last Post: 05-16-2000, 06:42 PM
-
By H. Wilson in forum Java
Replies: 6
Last Post: 04-14-2000, 11:25 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks