Skip to main content

Object Oriented Programming

Object Oriented Programming


  1. Programming paradigm that represents the concept of "objects" that have data fields (attributes that describe the object) and associated procedures known as methods
  2. Programming methodology based on objects, instead of just functions and procedures
  3. Focuses on data rather than process
  4. As individual objects can be modified without affecting other aspects of the program, it is easier for programmers to structure and organize software programs
  5. Easier to update and change programs written in object-oriented languages
  6. Simula was the first object oriented programming language


Eg: C++, Java, etc.

Features of OOPS

Objects


  1. Referred as instance of class
  2. Basic run-time entities in an object-oriented system a person, a place, a bank account, a table of data, etc can be an object
  3. They occupy space in memory that keeps its state 
  4. Each object contains data and code to manipulate the data 



Classes


  1. Blue print or prototype  which defines the variables and methods common to all the objects of certain kind user defined data types that behave like the built-in types of a programming language
  2. Objects of the same class share the same properties



Data abstraction


  1. act of representing essential-features without including the details or explanations.
  2. Provides the outside view of the object
  3. Separation of essential behavior form its implementation
  4. Since the classes use the concept of data abstraction, they are known as Abstract Data Types (ADT)



Data encapsulation


  1. Mechanism of binding the data and the codes (which manipulate the data) together
  2. Most important feature of OOPS that prevents outside interference as data is not accessible to the outside world and only those functions that are wrapped in the class can access it
  3. Acts like a protective wall.



Inheritance


  1. process by which objects of one class acquire the properties of objects of another class
  2. Helps in reducing the code size as common codes can be kept in a single class called base class
  3. Emphasizes on code reusability
  4. Feature of parent class are extracted by the derived (child) class.



Polymorphism


  1. ability to take more than one form
  2. Derived from Greek word “poly-morphs” meaning many forms
  3. An operation may exhibit different behavior in different situations depending upon the types of data used in the protram.



Dynamic binding


  1. refers to the linking of a procedure call to the code to be executed in response to the call the code associated with a given procedure call is not known until the time of call at run-time associated with polymorphism and inheritance.



Message passing

refers to the linking of a procedure call to the code to be executed in response to the call
the code associated with a given procedure call is not known until the time of call at run-time
associated with polymorphism and inheritance.

Operator Overloading


  1. Making the operator perform operations differently on the user defined data type (classes)
  2. Suppose A,B ,c are different objects of same class. Then, in C=A+B, “+” can be used to subtract the data of B from A.


Advantages of OOPS


  1. Inheritance
  2. Code reusability
  3. Time saving and higher productivity
  4. Higher security (data hiding)
  5. Easy partition and distribution of work


Application of OOPs


  1. Real time Systems
  2. Simulation and Modeling
  3. Hypertext and Hypermedia
  4. Decision support system
  5. CAM/CAE/CAD System
  6. Office Automation System
  7. AI and expert system







Comments

Popular posts from this blog

Passing arrays to functions in C programming

Like any other variables, we can also pass entire array to a function. An array name can be named as an argument for the prototype declaration and in function header. When we call the function no need to subscript or square brackets. When we pass array that pass as a call by reference because the array name is address for that array. /* Program to illustrate passing array to function */ #include<stdio.h> void display(int) ; /* function prototype */ main( ) { int num[5] = {100, 20, 40, 15, 33, i ; clrscr( ) ; printf (“\n The content of array is \n”) ; for (i=0; i<5; i++) display (num[i]) ; /*Pass array element fo fun */ getch{ } ; } void display(int n) { printf (“\t%d”, n ) ; } Output:     The content of array is 100      20       40       15 3 /* Program to read 10 numbers from keyboard to store these num into array and then c...

CPU (Central Processing Unit)

PGA reffered as pin grid array in which pins of CPU are lined up in a straight format. SPGA referred as staggered pin grid array. in which pins of CPU are arranged staggered format. LGA reffered to as Land Grid Array in which pins are available within inside the socket but not in the CPU in other words in line grid array, in CPU ther are no pinsbut insteadpins areattached with in a socket which contact with with the CPU. for e.g. LGA775 socket(no pins on cpu) has better cooling system. better contact and better locking(climbing). LGA1155: Letest generation I socket, also reffered as sandy bridge, Turbo boost overclocking. More resent than LGA 1156 socket. LGA1156: ability to north bridge Doul channel DDR3 optional integreted graphics PCI express LGA1366: hi end core i series socket integreted tiple channal memmory controller external control bridge(HUB) Upgrading CPU: need to check its core suppert check multiprocessor supports or not check on the ...

Recursive Function in C programming

             If a statement within the body of a function calls the same function, the function is called recursive function. Actually, recursion is a process by which a function calls itself repeatedly until some specified condition has been satisfied. This process is used for repetitive computations in which each action is stated in term of previous result. Many iterative or repetitive problems can be written in this form.                To solve a problem using recursive method, two conditions must be satisfied. They are: 1)       Problem could be written or defined in term of its previous result. 2)       Problem statement must include a stopping condition. /*   An example of recursive function to calculate factorial of a number.*/    #include<stdio.h>    #include<conio.h...