Introduction to classes
What is a class
Object and Class are the two basic principles of Object Oriented Programming,
They can be considered as the two sides of a coin, which cannot be disintegrated.
Each object belonging to a class, contains entire set of data and functions included in the class.
Understand concept of classes-
A class is a user defined blueprint or prototype from which objects are created.
It represents the set of properties or methods that are common to all objects of one type.
In general, class declarations can include these components, in order:
Modifiers : A class can be public or has default access.
Class name: The name should begin with a initial character.
Superclass(if any): The name of the class’s parent (superclass), if any, preceded by the keyword extends. A class can only extend (subclass) one parent.
Interfaces(if any): A comma-separated list of interfaces implemented by the class, if any, preceded by the keyword implements. A class can implement more than one interface.
Body: The class body surrounded by braces, { }.
Class name: The name should begin with a initial character.
Superclass(if any): The name of the class’s parent (superclass), if any, preceded by the keyword extends. A class can only extend (subclass) one parent.
Interfaces(if any): A comma-separated list of interfaces implemented by the class, if any, preceded by the keyword implements. A class can implement more than one interface.
Body: The class body surrounded by braces, { }.