// 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 */ // TestCircle.java: Demonstrate creating and using an object public class TestCircle { /**Main method*/ public static void main(String[] args) { Circle myCircle = new Circle(); // Create a Circle object System.out.println("The area of the circle of radius " + myCircle.radius + " is " + myCircle.findArea()); } } // Define the Circle class class Circle { double radius = 1.0; /**Return the area of this circle*/ double findArea() { return radius*radius*3.14159; } }