DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2005

    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.

  2. #2
    Join Date
    Aug 2005
    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
    DevSquare - Online Application Development

Similar Threads

  1. Replies: 2
    Last Post: 06-14-2006, 03:16 PM
  2. Java vs. .Net. A questionnaire
    By Basil in forum .NET
    Replies: 1
    Last Post: 05-13-2005, 06:46 AM
  3. API VB and JAVA
    By Mr. Spock in forum VB Classic
    Replies: 0
    Last Post: 08-24-2000, 12:34 PM
  4. Replies: 0
    Last Post: 05-16-2000, 06:42 PM
  5. Best Java Development environment
    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
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.