A class is a template,
blueprint, plan,design or prototype from which Objects can be derived.If you create an object
from a class , it means you created an instance of a class.
A small
example in my view.....
Suppose if you are planning to
construct a house first step what you will do ? you will go for design or
plan of it, Once plan is ready you will start actual
construction. By keeping this plan with you,
construct one more house ,like wise you can construct any
number of houses. Now here this plan is a class ,and actual
construction is object. this class doesn't occupy any memory only
object occupies memory. From one class we can create ‘N’ number of
objects.
No comments:
Post a Comment