Mastering Java: Class as a User Defined Data Type:
The class is the fundamental base of all Java programming. It is the logical construct upon which the entire programming
code is built. It has the capability to define the state and behaviour of its objects. The class implements the Object-
Oriented Programming (OOP) concepts in Java. If we wish to implement any OOP concept in a Java program, then it must
be encapsulated within a class.
The most important feature about a class is that it defines a new data type. Once defined, this new type can be used to
create objects of that type. Hence, we can say that a class is a template for an object, and an object is an instance of a
class.