This program consists of two functions in one class. It is the driver program for the CircleClass.java file.
Circle
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());
}
}
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.