Sample Java Program for Geometric Shape

Download Solution: Click to Download Solution
Solution File Name: GeometricShape.doc
Unzip Password: prestobear.com

Problem:
Sample Java Program for Geometric Shape


1. Circle.java
class Circle extends GeometricObject {

}

2. GeometricObject.java
public abstract class GeometricObject implements Comparable{

}

3. Rectangle.java
class Rectangle extends GeometricObject {

}

4. TestEx5.java

/**
 *  Modify the GeometricObject class to implement the Comparable interface, and define a static max method in the GeometricObject class for finding
 *  the larger of two GeometricObject objects. 
 *  
 *  Draw the UML diagram and implement the new GeometricObject class. Write a test program that uses the max method
 *  to find the larger of two circles and the larger of two rectangles.
 *  
 */

public class TestEx5 {

}

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.