SlideShare a Scribd company logo
INTRODUCTION TO OBJECT-
ORIENTED PROGRAMMING
(OOP)
1
OOP CONCEPT
ï‚ą Enable programmers to create modules that do not
need to be changed when a new type of object is
added.
ï‚ą Programmer can simply create a new object that
inherits many of its features from existing objects
ï‚ą Makes object-oriented programs easier to modify
2
HISTORY OF OOP
ï‚ą Many people believe that OOP is a product of the
1980s (Bjarne Stroustrup).
ï‚ą Actually, SIMULA 1 (1962) and Simula 67 (1967)
[earliest object-oriented languages]
ï‚ą The work on the Simula languages (Ole-John Dahl
and Kristen Nygaard) at the Norwegian Computing
Center in Oslo, Norway.
ï‚ą Most of the advantages of OOP available in the
earlier Simula languages, it wasn't until C++
became entrenched in the 1990s that OOP began
to flourish.
3
ADVANTAGES OF USING OOP
ï‚ą OOP provides a clear modular structure for
programs which makes it good for
defining abstract data types where implementation
details are hidden and the unit has a clearly defined
interface.
ï‚ą OOP makes it easy to maintain and modify existing
code as new objects can be created with small
differences to existing ones.
ï‚ą OOP provides a good framework for code libraries
where supplied software components can be easily
adapted and modified by the programmer.
4
TERMINOLOGIES OF OOP
ï‚ą Classes
ï‚ą Object
ï‚ą Encapsulation
ï‚ą Data Abstraction
ï‚ą Inheritance
ï‚ą Polymorphism
5
CLASSES
ï‚ą A collection of objects of a similar type.
ï‚ą Once a class is defined, any number of objects can
be created which belong to that class.
ï‚ą A class is a blueprint, or prototype, that defines the
variables and the methods common to all objects of
a certain kind.
6
OBJECT
ï‚ą An instance of a class.
ï‚ą A class must be instantiated into an object before it
can be used in the software.
ï‚ą A software bundle of related state and behavior.
ï‚ą More than one instance of the same class can be in
existence at any one time.
7
ENCAPSULATION
ï‚ą Storing data and functions in a single unit
(class).
ï‚ą Mechanism that binds together code and
data in manipulates.
ï‚ą Keeps both safe from outside interference
and misuse.
ï‚ą Data cannot be accessible to the outside
world and only those functions which are
stored in the class can access it.
8
DATA ABSTRACTION
ï‚ą Abstraction refers to the act of representing
essential features without including the background
details or explanations.
ï‚ą Classes use the concept of abstraction and are
defined as a list of abstract attributes.
9
INHERITANCE
ï‚ą Provides a powerful and natural mechanism for
organizing and structuring your software.
ï‚ą This section explains how classes inherit state and
behavior from their superclasses, and explains how
to derive one class from another using the simple
syntax provided by the Java programming
language.
10
POLYMORPHISM
ï‚ą The ability to take more than one form.
ï‚ą An operation may exhibit different behaviors in
different instances.
ï‚ą The behavior depends on the data types used in
the operation.
ï‚ą In general, polymorphism means “one interface,
multiple method”
ï‚ą Reduce complexity by allowing the same
interface to be used to specify a general class of
action.
11
DISTINGUISH BETWEEN ABSTRACTION AND
ENCAPSULATION
ABSTRACTION ENCAPSULATION
Refers to showing only the
necessary details to the intended
user
Means to hide (data hiding).
Wrapping, just hiding
properties and methods.
Used in programming languages
to make abstract class.
Used for hide the code and
data in a single unit to protect
the data from the outside the
world.
Abstraction is implemented using
interface and abstract class
Encapsulation is
implemented using private
and protected access
modifier. 12
EXAMPLES
ABSTRACTION
ENCAPSULATION
Class Encapsulation
{
private int marks;
public int Marks
{
get { return marks; }
set { marks = value;}
}
}
abstract class Abstraction
{
public abstract void
doAbstraction();
}
public class AbstractionImpl:
Abstraction
{
public void doAbstraction()
{
//Implement it
}
}
13
DIFFERENCES
Structured Programming OOP
Follow top-down approach to
program design.
Follow bottom-up approach in
program design.
Data and Functions don’t tide with
each other.
Functions and data are tide
together.
Large programs are divided into
smaller self contained program
segment known as functions.
Programs are divided into entity
called Objects.
Data moves openly around the
system from function to function.
Data is hidden and can’t be
accessed by the external world
Functions are dependent so
reusability is not possible
Functions are not dependent so
reusability is possible 14

More Related Content

PPTX
Introduction of OOPs
Integral University
 
PPTX
Encapsulation and inheritance
Chaudhary Kashif
 
PPTX
Very short OOP Introduction
Cristian G
 
PPTX
Basic Concepts Of OOPS/OOPS in Java,C++
Guneesh Basundhra
 
PPTX
encapsulation
shalini392
 
PPT
Oop concepts
Ritu Mangla
 
PDF
OOP vs COP
Gianluca Padovani
 
PPTX
Oops concepts
Kanan Gandhi
 
Introduction of OOPs
Integral University
 
Encapsulation and inheritance
Chaudhary Kashif
 
Very short OOP Introduction
Cristian G
 
Basic Concepts Of OOPS/OOPS in Java,C++
Guneesh Basundhra
 
encapsulation
shalini392
 
Oop concepts
Ritu Mangla
 
OOP vs COP
Gianluca Padovani
 
Oops concepts
Kanan Gandhi
 

What's hot (19)

PPTX
C++ with student management system project
Kratik Khandelwal
 
PPTX
Basic concept of Object Oriented Programming
Prognoz Technologies Pvt. Ltd.
 
DOCX
Encapsulation in C++
Hitesh Kumar
 
PPTX
Oo ps
Gowarthini
 
PPT
Ashish oot
Ashish Agrawal
 
PDF
Chapter2 Encapsulation (Java)
Dyah Fajar Nur Rohmah
 
PPTX
Encapsulation
saikat rahman
 
PPTX
Encapsulation
Githushan Gengaparam
 
PPTX
Oo ps concepts in c++
Hemant Saini
 
PPTX
Encapsulation C++
Hashim Hashim
 
PPTX
[OOP - Lec 08] Encapsulation (Information Hiding)
Muhammad Hammad Waseem
 
PDF
Single responsibility pattern
Arif Huda
 
PPTX
object oriented programing lecture 1
Geophery sanga
 
PPT
Encapsulation
FALLEE31188
 
PPTX
Presentation on oo ps 2
Avinash Kumar
 
PPTX
Oop in kotlin
Abdul Rahman Masri Attal
 
PPT
It seminar-xml serialization
Priyojit Mondal
 
C++ with student management system project
Kratik Khandelwal
 
Basic concept of Object Oriented Programming
Prognoz Technologies Pvt. Ltd.
 
Encapsulation in C++
Hitesh Kumar
 
Oo ps
Gowarthini
 
Ashish oot
Ashish Agrawal
 
Chapter2 Encapsulation (Java)
Dyah Fajar Nur Rohmah
 
Encapsulation
saikat rahman
 
Encapsulation
Githushan Gengaparam
 
Oo ps concepts in c++
Hemant Saini
 
Encapsulation C++
Hashim Hashim
 
[OOP - Lec 08] Encapsulation (Information Hiding)
Muhammad Hammad Waseem
 
Single responsibility pattern
Arif Huda
 
object oriented programing lecture 1
Geophery sanga
 
Encapsulation
FALLEE31188
 
Presentation on oo ps 2
Avinash Kumar
 
Oop in kotlin
Abdul Rahman Masri Attal
 
It seminar-xml serialization
Priyojit Mondal
 
Ad

Viewers also liked (8)

DOCX
Benefits of encapsulation
Muhammad Nawzir Khan
 
PPTX
Design Pattern Automation
PostSharp Technologies
 
PPTX
Functional Leap of Faith (Keynote at JDay Lviv 2014)
Tomer Gabel
 
PPT
Chapter 4 computer language
Azimjon Khamdamov
 
PPT
Maglev-A different way to develop with Ruby
Hernan Wilkinson
 
PPT
Avoiding to Reinvent the flat tire
Hernan Wilkinson
 
PPT
Design Pattern From Java To Ruby
Robbin Fan
 
PPT
History of computer language
Claire Punkcor
 
Benefits of encapsulation
Muhammad Nawzir Khan
 
Design Pattern Automation
PostSharp Technologies
 
Functional Leap of Faith (Keynote at JDay Lviv 2014)
Tomer Gabel
 
Chapter 4 computer language
Azimjon Khamdamov
 
Maglev-A different way to develop with Ruby
Hernan Wilkinson
 
Avoiding to Reinvent the flat tire
Hernan Wilkinson
 
Design Pattern From Java To Ruby
Robbin Fan
 
History of computer language
Claire Punkcor
 
Ad

Similar to Bab satu (20)

PPTX
the Concept of Object-Oriented Programming
Aida Ramlan II
 
PDF
What is Object-Oriented Programming (OOP) and Why Do We Need It?
MikeShadrin
 
PDF
Top 30 Technical interview questions
SohailSaifi15
 
PPTX
Chapter 04 object oriented programming
Praveen M Jigajinni
 
PPT
Object Oriented Language
dheva B
 
PDF
Ah java-ppt2
Haja Abdul Khader A
 
PPTX
1 intro
abha48
 
PPTX
Object oriented programming concept
Pina Parmar
 
PPTX
Java ppt.pptxkkkkkkkkkkkkkkkkkkkkkkkkkkk
BrazilAccount1
 
PPTX
JAVA_VR23_OOPS THROUGH JAVA PPT UNIT-1.pptx
netaji10700
 
PPS
OOP
Om Vikram Thapa
 
PDF
Oops concepts
ACCESS Health Digital
 
DOCX
A Survey of Object Oriented Programming LanguagesMaya Hris.docx
daniahendric
 
PPTX
Features of Object Oriented Programming.pptx
SwagatoBiswas
 
PDF
M.c.a. (sem iv)- java programming
Praveen Chowdary
 
PPTX
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING(OOP) AND PRINCIPLES.pptx
km687590
 
PPTX
OOPS 46 slide Python concepts .pptx
mrsam3062
 
PPTX
Birasa 1
Niyitegekabilly
 
PPTX
JAVA PROGRAMMING
Niyitegekabilly
 
the Concept of Object-Oriented Programming
Aida Ramlan II
 
What is Object-Oriented Programming (OOP) and Why Do We Need It?
MikeShadrin
 
Top 30 Technical interview questions
SohailSaifi15
 
Chapter 04 object oriented programming
Praveen M Jigajinni
 
Object Oriented Language
dheva B
 
Ah java-ppt2
Haja Abdul Khader A
 
1 intro
abha48
 
Object oriented programming concept
Pina Parmar
 
Java ppt.pptxkkkkkkkkkkkkkkkkkkkkkkkkkkk
BrazilAccount1
 
JAVA_VR23_OOPS THROUGH JAVA PPT UNIT-1.pptx
netaji10700
 
Oops concepts
ACCESS Health Digital
 
A Survey of Object Oriented Programming LanguagesMaya Hris.docx
daniahendric
 
Features of Object Oriented Programming.pptx
SwagatoBiswas
 
M.c.a. (sem iv)- java programming
Praveen Chowdary
 
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING(OOP) AND PRINCIPLES.pptx
km687590
 
OOPS 46 slide Python concepts .pptx
mrsam3062
 
Birasa 1
Niyitegekabilly
 
JAVA PROGRAMMING
Niyitegekabilly
 

Recently uploaded (20)

PDF
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
PPTX
Comunidade Salesforce SĂŁo Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira JĂșnior
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
DOCX
Top AI API Alternatives to OpenAI: A Side-by-Side Breakdown
vilush
 
PDF
Chapter 2 Digital Image Fundamentals.pdf
Getnet Tigabie Askale -(GM)
 
PPTX
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 
PDF
agentic-ai-and-the-future-of-autonomous-systems.pdf
siddharthnetsavvies
 
PDF
Software Development Company | KodekX
KodekX
 
PDF
This slide provides an overview Technology
mineshkharadi333
 
PDF
Revolutionize Operations with Intelligent IoT Monitoring and Control
Rejig Digital
 
PDF
Enable Enterprise-Ready Security on IBM i Systems.pdf
Precisely
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
Doc9.....................................
SofiaCollazos
 
PDF
CIFDAQ'S Market Insight: BTC to ETH money in motion
CIFDAQ
 
PDF
CIFDAQ's Teaching Thursday: Moving Averages Made Simple
CIFDAQ
 
PDF
REPORT: Heating appliances market in Poland 2024
SPIUG
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
Comunidade Salesforce SĂŁo Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira JĂșnior
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
Top AI API Alternatives to OpenAI: A Side-by-Side Breakdown
vilush
 
Chapter 2 Digital Image Fundamentals.pdf
Getnet Tigabie Askale -(GM)
 
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 
agentic-ai-and-the-future-of-autonomous-systems.pdf
siddharthnetsavvies
 
Software Development Company | KodekX
KodekX
 
This slide provides an overview Technology
mineshkharadi333
 
Revolutionize Operations with Intelligent IoT Monitoring and Control
Rejig Digital
 
Enable Enterprise-Ready Security on IBM i Systems.pdf
Precisely
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
Doc9.....................................
SofiaCollazos
 
CIFDAQ'S Market Insight: BTC to ETH money in motion
CIFDAQ
 
CIFDAQ's Teaching Thursday: Moving Averages Made Simple
CIFDAQ
 
REPORT: Heating appliances market in Poland 2024
SPIUG
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 

Bab satu

  • 1. INTRODUCTION TO OBJECT- ORIENTED PROGRAMMING (OOP) 1
  • 2. OOP CONCEPT ï‚ą Enable programmers to create modules that do not need to be changed when a new type of object is added. ï‚ą Programmer can simply create a new object that inherits many of its features from existing objects ï‚ą Makes object-oriented programs easier to modify 2
  • 3. HISTORY OF OOP ï‚ą Many people believe that OOP is a product of the 1980s (Bjarne Stroustrup). ï‚ą Actually, SIMULA 1 (1962) and Simula 67 (1967) [earliest object-oriented languages] ï‚ą The work on the Simula languages (Ole-John Dahl and Kristen Nygaard) at the Norwegian Computing Center in Oslo, Norway. ï‚ą Most of the advantages of OOP available in the earlier Simula languages, it wasn't until C++ became entrenched in the 1990s that OOP began to flourish. 3
  • 4. ADVANTAGES OF USING OOP ï‚ą OOP provides a clear modular structure for programs which makes it good for defining abstract data types where implementation details are hidden and the unit has a clearly defined interface. ï‚ą OOP makes it easy to maintain and modify existing code as new objects can be created with small differences to existing ones. ï‚ą OOP provides a good framework for code libraries where supplied software components can be easily adapted and modified by the programmer. 4
  • 5. TERMINOLOGIES OF OOP ï‚ą Classes ï‚ą Object ï‚ą Encapsulation ï‚ą Data Abstraction ï‚ą Inheritance ï‚ą Polymorphism 5
  • 6. CLASSES ï‚ą A collection of objects of a similar type. ï‚ą Once a class is defined, any number of objects can be created which belong to that class. ï‚ą A class is a blueprint, or prototype, that defines the variables and the methods common to all objects of a certain kind. 6
  • 7. OBJECT ï‚ą An instance of a class. ï‚ą A class must be instantiated into an object before it can be used in the software. ï‚ą A software bundle of related state and behavior. ï‚ą More than one instance of the same class can be in existence at any one time. 7
  • 8. ENCAPSULATION ï‚ą Storing data and functions in a single unit (class). ï‚ą Mechanism that binds together code and data in manipulates. ï‚ą Keeps both safe from outside interference and misuse. ï‚ą Data cannot be accessible to the outside world and only those functions which are stored in the class can access it. 8
  • 9. DATA ABSTRACTION ï‚ą Abstraction refers to the act of representing essential features without including the background details or explanations. ï‚ą Classes use the concept of abstraction and are defined as a list of abstract attributes. 9
  • 10. INHERITANCE ï‚ą Provides a powerful and natural mechanism for organizing and structuring your software. ï‚ą This section explains how classes inherit state and behavior from their superclasses, and explains how to derive one class from another using the simple syntax provided by the Java programming language. 10
  • 11. POLYMORPHISM ï‚ą The ability to take more than one form. ï‚ą An operation may exhibit different behaviors in different instances. ï‚ą The behavior depends on the data types used in the operation. ï‚ą In general, polymorphism means “one interface, multiple method” ï‚ą Reduce complexity by allowing the same interface to be used to specify a general class of action. 11
  • 12. DISTINGUISH BETWEEN ABSTRACTION AND ENCAPSULATION ABSTRACTION ENCAPSULATION Refers to showing only the necessary details to the intended user Means to hide (data hiding). Wrapping, just hiding properties and methods. Used in programming languages to make abstract class. Used for hide the code and data in a single unit to protect the data from the outside the world. Abstraction is implemented using interface and abstract class Encapsulation is implemented using private and protected access modifier. 12
  • 13. EXAMPLES ABSTRACTION ENCAPSULATION Class Encapsulation { private int marks; public int Marks { get { return marks; } set { marks = value;} } } abstract class Abstraction { public abstract void doAbstraction(); } public class AbstractionImpl: Abstraction { public void doAbstraction() { //Implement it } } 13
  • 14. DIFFERENCES Structured Programming OOP Follow top-down approach to program design. Follow bottom-up approach in program design. Data and Functions don’t tide with each other. Functions and data are tide together. Large programs are divided into smaller self contained program segment known as functions. Programs are divided into entity called Objects. Data moves openly around the system from function to function. Data is hidden and can’t be accessed by the external world Functions are dependent so reusability is not possible Functions are not dependent so reusability is possible 14

Editor's Notes

  • #3: type of programming in which programmers define not only the data type of a data structure, but also the types of operations (functions) that can be applied to the data structure. In this way, the data structure becomes an object that includes both data and functions. In addition, programmers can create relationships between one object and another. For example, objects
  • #7: A class is a blueprint or prototype from which objects are created. This section defines a class that models the state and behavior of a real-world object. It intentionally focuses on the basics, showing how even a simple class can cleanly model state and behavior.