Overview of Object-Oriented Programming (OOP)


<aside> <img src="/icons/table_red.svg" alt="/icons/table_red.svg" width="40px" /> Table of Contents

</aside>

<aside> 💡

  1. Object-Oriented Programming (OOP) </aside>

<aside> 💡

</aside>

<aside> 💡

</aside>


Object-Oriented Programming (OOP)


  1. Java OOPs Concepts

    1. Object-Oriented Programming is a paradigm that provides many concepts, such as inheritance, data binding, polymorphism, etc.
    2. Simula is considered the first object-oriented programming language. The programming paradigm where everything is represented as an object is known as a pure object-oriented programming language.
    3. Smalltalk is considered the first truly object-oriented programming language.
    4. The popular object-oriented languages are Java, C#, PHP, Python, C++, etc.
    5. The aim of object-oriented programming is to implement real-world entities, for example, object, classes, abstraction, inheritance, polymorphism, etc.

  2. OOPs (Object-Oriented Programming)

    1. Object means a real-world entity such as a pen, chair, table, computer, watch, etc. Object-Oriented Programming is a methodology or paradigm to design a program using classes and objects. It simplifies software development and maintenance by providing some concepts:

      1. Object

      2. Class

      3. Inheritance

      4. Polymorphism

      5. Abstraction

      6. Encapsulation

        image.png

    2. Apart from these concepts, there are some other terms which are used in Object-Oriented design:

      1. Coupling
      2. Cohesion
      3. Association
      4. Aggregation
      5. Composition

  3. Object

    1. Any entity that has state and behavior is known as an object. For example, a chair, pen, table, keyboard, bike, etc. It can be physical or logical.

    2. An Object can be defined as an instance of a class. It contains an address and takes up some space in memory. Objects can communicate without knowing the details of each other's data or code. The only necessary thing is the type of message accepted and the type of response returned by the objects.

      image.png

    3. An instance of a class.

    4. Occupies memory and performs actions defined by the class.

    5. Example: A dog is an object because it has states like color, name, breed, etc. as well as behaviors like wagging the tail, barking, eating, etc.


  4. Class

    1. Collection of objects is called class. It is a logical entity.
    2. A class can also be defined as a blueprint from which you can create an individual object. Class does not consume any space.
    3. Defines attributes (fields) and behaviors (methods) of objects.
    4. Does not occupy memory until instantiated.