Posts

OOP in C# part 02

Image
Encapsulation combining data,functions into a single unit called class and hiding internal details of object. Generally, Data hides for security such as making the variables as private.Encapsulation is implemented by using access specifiers. C# supports the following access specifiers: Real world example: TV Remote Abstraction   Process of hiding the details of implementation and display the essential feature (describe object, by define their unique & relevant characteristic) Real world example: TV  Encapsulation vs Abstraction Encapsulation Abstraction Solves the problem at Implementation level Design level Hide Code and data in class to protect Unwanted data and provide relevant data Inheritance A Class that derive from another class known as base class. This promote reuse and maintainability Public class parent{ //create constructor Public parent(){ Console.WriteLine( "Constructor." ); } public void display() {   ...

OOP in C#

Image
OOP in C# Class Blue print of Real word object Simply 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  Class  Object Existence Logical existence Physical existence Memory Allocation Memory space is not allocated, when it is created. Memory space is allocated, when it is create...