Ans to the question no: 01
What is Class?
A class is an entity that determines how an object will behave and what the object will contain. In other words, it is a blueprint or a set of instruction to build a specific type of object.
What is Object?
An object is nothing but a self-contained component that consists of methods and properties to make a data useful. It helps you to determines the behaviour of the class.
1) A class is a template used for the creation of objects. An object is an instance of a class.
2) While a class is a logical entity, an object is a physical entity.
3) A class doesn't take any memory spaces when a programmer creates one. An object takes memory when a programmer creates one.
4) The class has to be declared only once. Objects can be declared several times depending on the requirement.
Ans to the question no: 02
Example:
- Class: Dogs
- Objects: size, age, colour, breed, etc.