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

O Level Practical Queestion Paper (MS-OFFICE, MSDOS, MS-EXCEL, ICT Resources)

MSDOS 1. Write command to display all files having extension ‘jpg’. 2. Write command to display all files of all types starting with letter ‘m’. 3. Write command to display all files having names up to ten characters with second last letter as ‘n’, e.g. intelligent. 4. Write a command to copy the file mars of type exe from the directory ‘space’ of drive U to another directory “universe” in drive S. 5. Write a command to delete the directory as well as the files of the directory ‘world’ on drive E. 6. Write command to display all file names on the disk in drive A and having an extension of no more than two characters.   7. Write command to copy all the files beginning with ‘m’ and whose file names has a ‘txt’ extension from drive A to the ‘\document’ directory on drive C. 8. Write set of commands to create a subdirectory of the root directory called ‘exercise’, and then move into it 9. Perform the following tasks using DOS commands in the DOS sh...

IICS College 15th August Celebration Day

IICS COLLEGE  15th August Celebration Day

Learn Programming in UNIX

Q: - Write a program to input two numbers and add them?             gedit add.sh             clear             echo “enter two numbers:”             read a             read b             sum=`expr$a+$b`             echo $sum Syntax for if-else:- (1)          if test condition             then                 ---------                 --...