![]() |
|
![]() | ||
|
Subject:
interface problem need help
Category: Computers > Programming Asked by: nisao-ga List Price: $5.00 |
Posted:
05 Feb 2003 13:54 PST
Expires: 07 Mar 2003 13:54 PST Question ID: 157747 |
- Create an interface named ComparableObject that implements Comparable interface with one method compareTo(Object obj, Object obj). This method compares two objects of any type and return the object with the larger area. (assume that one object belongs to the class Rectangle, and one belongs to the class Circle) - Implement the compareTo(Object obj) method to compare the rectangles and circles on their areas and radii accordingly. - Write a test class to find: - maximum between two instances of ComparableRectangle objects. (object with the larger area) - maximum between two instances of ComparableCircle objects. (object with the larger radius) - maximum between two instances of ComparableCircle object and. ComparableRectangle object (object with the larger area) using the compareTo(Object obj, Object obj2) method from your interface ComparableObject. | |
|
![]() | ||
|
There is no answer at this time. |
![]() | ||
|
There are no comments at this time. |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |