classes and objects in java example programs