import java.awt.*; // make the graphics libraries available
import java.applet.*; // make the applet libraries available
public class PersonalDetails extends Applet // make a new applet
{
private int age; // declare an integer variable to hold a person's age
public void paint(Graphics g)
{
age = 21; // assign the value 21 to the age variable
g.drawString("This person's age is " + age, 20, 20);
}
} |