0% found this document useful (0 votes)
2 views1 page

OOP Principles Explained: Key Concepts

The document outlines the four fundamental concepts of Object-Oriented Programming (OOP): encapsulation, polymorphism, inheritance, and abstraction. Encapsulation combines data and methods into a class, allowing for data hiding. Polymorphism allows a single interface to represent different types, inheritance enables new objects to inherit properties from existing ones, and abstraction hides unnecessary details to reduce complexity.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

OOP Principles Explained: Key Concepts

The document outlines the four fundamental concepts of Object-Oriented Programming (OOP): encapsulation, polymorphism, inheritance, and abstraction. Encapsulation combines data and methods into a class, allowing for data hiding. Polymorphism allows a single interface to represent different types, inheritance enables new objects to inherit properties from existing ones, and abstraction hides unnecessary details to reduce complexity.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

OOP CONCEPTS/PRINCIPLE:

Four fundamental concept of OOP are:


Encapsulation, inheritance, polymorphism, and abstraction.

1-Encapsulation:
Encapsulation in Java is a mechanism of wrapping the data (variables) and code acting on
the data (methods) together as a single unit. Encapsulation is the process of combining
data and functions into a single unit called class. ... In simpler words, attributes of the class
are kept private and public getter and setter methods are provided to manipulate these
attributes. Thus, encapsulation makes the concept of data hiding possible.

2-Polymorphism:
In programming languages and type theory, polymorphism is the provision of a single
interface to entities of different types or the use of a single symbol to represent multiple
different types. For example, a Shape interface can represent to different entities like
rectangle, triangle and circle etc.

3-Inheritance:
In object-oriented programming, inheritance enables new objects to take on the
properties of existing objects. A class that is used as the basis for inheritance is called a
superclass or base class. A class that inherits from a superclass is called a subclass or
derived class.

4-Abstraction:
Through the process of abstraction, a programmer hides all but the relevant data about an
object in order to reduce complexity and increase efficiency. In other words, necessary
data is displayed and internal details are hide.

You might also like