0
OOPs concepts
Posted by Rajendra Prasad Panchati
on
Wednesday, February 17, 2010
in
C#.Net
Object oriented Programming is a type of programming in which programmers define not only the data type of a data structure, but also the types of operations (functions) that can be applied to the data structure. In this way, the data structure becomes an object that includes both data and functions. In addition, programmers can create relationships between one object and another. For example, objects can inherit characteristics from other objects.
One of the principal advantages of object-oriented programming techniques over procedural programming techniques is that they enable programmers to create modules that do not need to be changed when a new type of object is added. A programmer can simply create a new object that inherits many of its features from existing objects. This makes object-oriented programs easier to modify.
Basic Concepts of OOP..
1)Class
2)Object
3)Method
4)Inheritance
5)Abstraction
6)Encapsulation
7)Polymorphism
In briefly,
Class :
A user-defined data structure that groups properties and methods. Class doesn’t occupies memory.
Object :
Instance of Class is called object. An object is created in memory using keyword
“new”.
One of the principal advantages of object-oriented programming techniques over procedural programming techniques is that they enable programmers to create modules that do not need to be changed when a new type of object is added. A programmer can simply create a new object that inherits many of its features from existing objects. This makes object-oriented programs easier to modify.
Basic Concepts of OOP..
1)Class
2)Object
3)Method
4)Inheritance
5)Abstraction
6)Encapsulation
7)Polymorphism
In briefly,
Class :
A user-defined data structure that groups properties and methods. Class doesn’t occupies memory.
Object :
Instance of Class is called object. An object is created in memory using keyword
“new”.
1.Abstraction 2.Encapsulation 3.Inheritance 4.Polymorphisam Abstraction:- Hidding non-essential features and showing the essential features (or) Hidding unnecessary data from the users details, is called abstraction. Real Time example: TV Remote Button in that number format and power buttons and other buttons there just we are seeing the buttons, we don't see the button circuits .i.e buttons circuits and wirings all are hidden. so i think its good example. Encapsulation: Writing Operations and methods stored in a single class. This is Called Encapsulation Real Time Example: Medical Capsuals i.e one drug is stored in buttom layer and another drug is stored in Upper layer these two layers are combined in single capsual. Inheritance: The New Class is Existing from Old Class, i.e SubClass is Existing from Super Class. Real Time Example: Father and Son Relationship Polymorphism: Sinle Form behaving differently in different Situations. Example:- Person Person in Home act is husband/son, in Office acts Employer. in Public Good Citizen.
More
Less