0% found this document useful (0 votes)
8 views

1 - Object Oriented Programming

Uploaded by

ankurbiswas.uem
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

1 - Object Oriented Programming

Uploaded by

ankurbiswas.uem
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

OBJECT ORIENTED

PROGRAMMING USING JAVA


CHAPTER – 1
INTRODUCTION TO OOPS
INTRODUCTION TO OBJECT ORIENTED
PROGRAMMING USING JAVA
Some of the features of object oriented programming are : Method Method
1. Emphases is on data rather than procedure. Data

2. Programs are divided into what are known as Objects. Method Method

3. Data structures are designed such that they characterize the objects. Fig: Object + Method
4. Methods that operate on the data of an object are tied together in the data structure.
5. Data is hidden and cannot be accessed by external functions.
6. Objects may communicate with each other through methods.
7. New data and methods can be easily added whenever necessary.
8. Follows bottom-up approach in program design.

29-01-2023 Ankur Biswas (ANB) 2


FORMAL DEFINITION
• Object-oriented programming is a approach that provides a way of modularizing programs by
creating partitioned memory area for both data and functions that can be used as templates
for creating copies of such modules on demand.
• The organization of an object-oriented program also makes the method beneficial to
collaborative development, where projects are divided into groups. Additional benefits of OOP
include code reusability, scalability and efficiency.

29-01-2023 Ankur Biswas (ANB) 3


STRUCTURE OF OBJECT ORIENTED
PROGRAMMING
The structure, or building blocks, of object-oriented programming include the following:
• 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. Objects can correspond to real-
world objects or an abstract entity. When class is defined initially, the description is the only object
that is defined.
• Methods are functions that are defined inside a class that describe the behaviors of an object. Each
method contained in class definitions starts with a reference to an instance object. Additionally, the
subroutines contained in an object are called instance methods. Programmers use methods for
reusability or keeping functionality encapsulated inside one object at a time.
• Attributes are defined in the class template and represent the state of an object. Objects will have
data stored in the attributes field. Class attributes belong to the class itself.

29-01-2023 Ankur Biswas (ANB) 4


PRINCIPLES OF OBJECT ORIENTED
PROGRAMMING
• Data Abstraction. Abstraction refers to the act of representing essential features without
including the background details or explanations.
• Encapsulation. This principle states that all important information is contained inside an object
and only select information is exposed. The implementation and state of each object are
privately held inside a defined class. Other objects do not have access to this class or the
authority to make changes. They are only able to call a list of public functions or methods.
This characteristic of data hiding provides greater program security and avoids unintended
data corruption.

29-01-2023 Ankur Biswas (ANB) 5


PRINCIPLES OF OBJECT ORIENTED
PROGRAMMING
• Inheritance: Inheritance is the process by which objects of one class acquire the properties of
object of another class. Inheritance supports the concept of hierarchical classification.

• In OOP the concept of inheritance provides the idea of reusability. It means that we can add
additional features to a n existing class without modifying it. This is possible by deriving a
new class from the existing one.

29-01-2023 Ankur Biswas (ANB) 6


PRINCIPLES OF OBJECT ORIENTED
PROGRAMMING

Fig: Property Inheritance

29-01-2023 Ankur Biswas (ANB) 7


PRINCIPLES OF OBJECT ORIENTED
PROGRAMMING
• Polymorphism: Polymorphism means the liability to take more than one form. For example, an
operation may exhibit different behavior depends upon the types of data used in the
operation.

Fig: Polymorphism

29-01-2023 Ankur Biswas (ANB) 8


THANK YOU

29-01-2023 Ankur Biswas (ANB) 9

You might also like