Skip to main content

Concept of Object-Oriented Programming Concept

Concept of Object-Oriented Programming Concept
  • Object Oriented Programming is performed by using class and object. 
  • Class is a set of States and behaviors.
  • Class is also known as a blue print of an object.
  • Class is called an Object factory where more than one object is created.
  • The object is used for accessing all the functionality of Class.
  • An example of Class and Object is
    • CAR----> It is a class 
    • Wagon R, Maruti 800, Alto, Seltos, etc are examples of objects.
  • Object-Oriented Principle:-
    • Encapsulation:- It is a process of binding the data and method in a single unit. A general example of encapsulation is Capsules, Bike, Cake, and others where the data is wrapped in a single unit. The Class is also an example of Encapsulation because Class also binds the state and behavior.


    • Abstraction: Abstraction is a process where only essential information is shown for use and unnecessary information about an object is hidden from the user. ATM is an example of Abstraction where users only access essential data. In programming the scope of data(Public, Private, Protected) helps to abstract the data from the user.






    • Polymorphism:- Polymorphism is made up of two words: Ploy--> Many and Morphism--> Forms. Polymorphism helps to use a single name function with multiple arguments. It helps the programmer to prevent learning the different names of functions.                                    
                 Example: Shapes-->Circle,Rectangle, Ovel                                                                              Programming Example:- Add(int,int)  Add(int, double)  Add(double,double)                     Add(double,int)     Add(String, String)


    • Inheritance:- Inheritance allows to access the property of Base Class(Parent Class) to Sub Class(Child Class). With the help of Inheritance, the code is reusable and shared with an object. For Ex.:- The Property of a parent can be accessible by the child. 




Comments

Popular posts from this blog

Multiple Inheritance

Multiple Inheritance In multiple inheritance a class can access the property of more than one class. This inheritance is use for multiple accessing of properties. In multiple inheritance ambiguty is  occured when same name function is declare in both class and the object is confuse with function is called.  syntax − class derived-class: access baseA, access baseB.... Where access is one of public, protected, or private and would be given for every base class and they will be separated by comma as shown above. Let us try the following  example − #include <iostream.h> #include <conio.h>  // Base Class class Shape  {    public:       void getwidth(int w) {          width = w;       }       void getheight(int h) {          height = h;       }           prot...

CODD RULES of RDBMS

Codd’s rules for RDBMS (i)                 The information rule. (ii)              Guaranteed access of   data (iii)            Systematic treatment of null value. (iv)            On line DB support. (v)              Comprehensive sup-language rule. (vi)            The view update rule. (vii)         Insert update rule. (viii)       Physical data independence. (ix)            Logical data independence. (x)              Integrity rule (xi)  ...