// package chapter6; /** * Title: Chapter 6, "Programming with Objects and Classes" * Description: Examples for Chapter 6 * Copyright: Copyright (c) 2000 * Company: Armstrong Atlantic State University * @author Y. Daniel Liang * @version 1.0 */ // TestCircleWithAccessors.java: Demonstrate private modifier public class TestCircleWithAccessors { /**Main method*/ public static void main(String[] args) { // Create a Circle with radius 5.0 CircleWithAccessors myCircle = new CircleWithAccessors(5.0); System.out.println("The area of the circle of radius " + myCircle.getRadius() + " is " + myCircle.findArea()); // Increase myCircle's radius by 10% myCircle.setRadius(myCircle.getRadius()*1.1); System.out.println("The area of the circle of radius " + myCircle.getRadius() + " is " + myCircle.findArea()); } }