ScholarQuill logoScholarQuillUniversity Notes
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
Study Tools
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
Contact
ScholarQuill logo
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
ScholarQuill logoScholarQuillUniversity Notes
Study PortalCOMP2111Oop Concepts Introduct…
Ctrl + K
Login
Explore
Search
Semester
Papers
CGPA
    COMP2111

    Object Oriented Programming

    Progress0 / 23 done
    Topics23
    1Introduction to object oriented design2History and advantages of object oriented design3Introduction to object oriented programming concepts4Classes and objects5Data encapsulation6Constructors and destructors7Access modifiers8Const vs non-const functions9Static data members & functions10Function overloading11Operator overloading12Identification of classes and their relationships13Composition and aggregation14Inheritance15Multiple inheritance16Polymorphism17Abstract classes and interfaces18Generic programming concepts19Function & class templates20Standard template library21Object streams22Data and object serialization using object streams23Exception handling
    2 min read
    Topic 3 of 23
    Topic Study Note Illustration
    03

    Introduction to object oriented programming concepts

    Introduction to Object-Oriented Programming Concepts

    Introduction to Object-Oriented Programming Concepts

    Object-Oriented Programming (OOP) is a method of writing software that organizes code using objects. These objects represent real-world entities and combine both data (variables) and behavior (functions) into a single unit. This approach makes programs easier to understand, maintain, and expand.

    Core Concepts of Object-Oriented Programming:

    1. Class
      A class is a blueprint or template used to create objects. It defines the structure and behavior that the objects will have.
      Example: A Car class can have data like color, speed, and model, and functions like start(), stop(), and accelerate().

    2. Object
      An object is an instance of a class. When a class is created, it does not use memory until an object is created from it. Each object has its own copy of data and can use the functions defined in the class.
      Example: Car myCar; creates an object named myCar from the Car class.

    3. Encapsulation
      Encapsulation means bundling data and the functions that work on that data into a single unit (object). It also means hiding the internal details from the outside world, only exposing what is necessary.
      This is usually done using access specifiers like private, public, and protected.

    4. Abstraction
      Abstraction means showing only the essential features and hiding the details. It allows the user to interact with the object without needing to understand its inner complexity.
      For example, when using a car, you just drive it without knowing how the engine works.

    5. Inheritance
      Inheritance allows one class to inherit properties and methods from another class. This helps in reusing code and creating a relationship between classes.
      Example: A Truck class can inherit from the Vehicle class and automatically get its features.

    6. Polymorphism
      Polymorphism means one name but many forms. It allows the same function or method to act differently based on the object or data type.
      It is commonly used in function overloading and overriding.

    How OOP Helps in Programming:

    • Reduces code duplication by using inheritance
    • Helps manage complexity by organizing code around real-world things
    • Makes programs easier to modify and maintain
    • Encourages reusability and better structure

    Object-oriented programming is a powerful way to create clean, organized, and efficient software by modeling it after real-life systems using classes and objects.

    ← Previous topic 2
    History and advantages of object oriented design
    Next topic 4 →
    Classes and objects

    Past Papers

    Open this section to view and download past papers

    Click on Show Past Papers to load available exam papers.

    Reading Progress
    0%
    2mremaining
    369words
    Beginnerlevel
    On This Page

    No headings found

    Study Toolkit

    Subject Portal

    Object Oriented Programming