package examples; /** * CS401 Example IntCircle * * @author Dr. Ramirez */ public class IntCircle { // instance variable is private. This means that we can access it within // this class, but NOT outside the class private int radius; // constructor. Note that there is no return type public IntCircle(int r) { radius = r; } // accessor to return the area of the circle public double area() { return (Math.PI * radius * radius); } // accessor to return the cirumference of the circle public double circumference() { return (2 * Math.PI * radius); } // accessor to return the circle information as a String public String toString() { return ("Radius: " + radius); } // mutator to change the radius public void setRadius(int r) { radius = r; } }