Google Answers Logo
View Question
 
Q: interface problem need help ( No Answer,   0 Comments )
Question  
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.

Request for Question Clarification by maniac-ga on 05 Feb 2003 15:54 PST
Hello Nisao,

Is there a specific language to be used (e.g., Ada, C++, Java) that is
to be used?

I assume both the class ComparableRectangle and class ComparableCircle
extend class ComparableObject. Are there other existing object types
that need to be inherited?

If this is homework, please note that some teachers might reject a
solution that a Google Answers researcher produces. If this is a
problem for you - please indicate what kind of help you need (in lieu
of a working test program).
  --Maniac
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

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 Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy