Now that you have a .class file, you can run your program. Run the Program. The first bold line in the following listing begins a class definition block . Thus, the skeleton of any Java program is a class definition . When you instantiate a class you create an object that looks and feels like other instances of the same class.
Methods are similar to the functions or procedures in procedural languages such as Fortran.
Julia Child's recipe for rack of lamb is a real-world example of a class. Her rendition of the rack of lamb is one instance of the recipe, and mine is quite another. A more traditional example from the world of programming is a class that represents a rectangle. The class would contain variables for the origin of the rectangle, its width, and its height. The class might also contain a method that calculates the area of the rectangle.