// An application with a class that provides information
about a person.
class People
{
public static void main (String []
args)
{
Person girl
= new Person ();
girl.displayAge
();
} // main method
} // class People
// Class that stores information about a person's name
and age.
class Person
{
private String name;
private int age;
// Constructor class that initializes
person.
public Person ()
{
name = "Alice";
age = 7;
} // constructor
// Method that displays the name and
age of a person.
public void displayAge ()
{
System.out.println
(name + "'s age is " + age);
} // method displayAge
} // class Person