Class fundamentals
The classes created in the primarily exist easily to encapsulate the main () method, that has been used to demonstrate the basics of the Java syntax. Perhaps the most important thing to understand about a class is which it defines a new data type. Once it is defined, this new type can be used to create objects of that type. Therefore, a class is a template for an object, and an object is an example of a class. Since an object is an example of a class, you will frequently see the two words object and example used interchangeably.