OOP in C#
OOP in C#
Class
Blue print of Real word objectSimply class is provide common structure to guide for making something
OR
Defines the characteristics of an entity, and includes properties that define the types of data that the object can contain and methods that describe the behavior of the object.
Example: Animal is commonly using noun. So Animal has name,eye, body, leg etc.... these feature common for all animal.
Object
Object is real word entity. Feature, An object is a block of
memory that has been allocated and configured according to the blueprint
(class).Objects are also called instances
Example: Animal = {dog, cat}
Dog and Cat are
real word existing thing.
Class vs. Object
|
|
|
Existence
|
Logical existence
|
Physical existence
|
Memory Allocation
|
Memory space is not allocated, when it is created.
|
Memory space is allocated, when it is created.
|
Declaration/definition
|
Definition is created once.
|
it is created many time as you require.
|
Comments
Post a Comment