Programming with C

⌘K
  1. Home
  2. Docs
  3. Programming with C
  4. Basics of C Programming
  5. Introduction to Programmi...
  6. Object-Oriented Programming

Object-Oriented Programming

Object-Oriented Programming

  • The Program is divided into number of small units called Object. The data and function are built around these objects.
  • The data of the objects can be accessed only by the functions associated with that object.
  • The functions of one object can access the functions of another object

Structure of Object-Oriented Programming

Features of OOP

  • Emphasis on data rather than algorithm
  • Data is hidden and cannot be accessed by external functions
  • Objects may communicate with each other through functions
  • New data and functions can be easily added whenever necessary
  • Follows bottom-up approach in program design

Example

  • C++
  • Java

Advantages

  • Data security
  • Inheritance
  • Code reusability
  • Flexible and abstraction is also present

Disadvantages

  • Steep Learning Curve: It is complex to create programs based on interaction of objects. Some of the key techniques like inheritance and polymorphism can be difficult initially
  • Larger Program size: Object-oriented programs typically involve more lines of code than procedural programs
  • Slower Programs: Object-oriented programs are typically slower than procedure-based programs, as they typically require more instructions to be executed

Views: 0

How can we help?

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments