Understanding OOPS Concepts with Real Life Examples

Object-oriented Programming

Class and Object

Classes are user-defined data types that act as the blueprint for individual objects, attributes and methods. Objects are instances of a class created with specifically defined data. Examples If animal is the class then dog is the object, if human is the class then man is the object.

Object-oriented Programming

Encapsulation

Encapsulation in OOPs is the concept of binding fields (object state) and methods (behavior) together as a single unit. Programming languages such as Java use encapsulation in the form of classes Examples School Bag can keep your pen, books, launch box so on

Object-oriented Programming

Polymorphism

Polymorphism is a feature of object-oriented programming languages that allows a specific routine to use variables of different types at different times. Examples On Next Page

Object-oriented Programming

Abstraction

Abstraction is the process of hiding the internal details of an application from the outer world. Abstraction is used to describe things in simple terms. It's used to create a boundary between the application and the client programs. Examples On Next Page

Object-oriented Programming

Inheritance

Inheritance is the mechanism of basing an object or class upon another object or class, retaining similar implementation. Also defined as deriving new classes from existing ones such as super class or base class and then forming them into a hierarchy of classes. Examples On Next Page

Next Story