Sample Java Program for Geometric Shape

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

Sample Java Program for Geometric Shape

class Circle extends GeometricObject {


public abstract class GeometricObject implements Comparable{


class Rectangle extends GeometricObject {



 *  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.