Circle

Updated Dani 0 Tallied Votes 192 Views Share

This program consists of two functions in one class. It is the driver program for the CircleClass.java file.

package circle;
public class Circle
{
    public static void main(String args[])
    {
        CircleClass myCircle = new CircleClass(10);
        CircleClass yourCircle = new CircleClass();
        printout(myCircle);
        printout(yourCircle);
        myCircle.setCircumference(25);
        printout(myCircle);
        myCircle.setCircumference(175);
        printout(myCircle);
    }
    public static void printout(CircleClass x)
    {
        System.out.print("\n\n\tRadius = " + x.getRadius());
        System.out.print("\n\tCircumference = " + x.getCircumference());
        System.out.print("\n\tArea = " + x.getArea());
    }
}