SlideShare a Scribd company logo
1 of 14
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

What's hot (19)

C++ with student management system project
C++ with student management system projectC++ with student management system project
C++ with student management system project
 
Basic concept of Object Oriented Programming
Basic concept of Object Oriented Programming Basic concept of Object Oriented Programming
Basic concept of Object Oriented Programming
 
Encapsulation in C++
Encapsulation in C++Encapsulation in C++
Encapsulation in C++
 
Oo ps
Oo psOo ps
Oo ps
 
Ashish oot
Ashish ootAshish oot
Ashish oot
 
Mca 504 dotnet_unit3
Mca 504 dotnet_unit3Mca 504 dotnet_unit3
Mca 504 dotnet_unit3
 
Chapter2 Encapsulation (Java)
Chapter2 Encapsulation (Java)Chapter2 Encapsulation (Java)
Chapter2 Encapsulation (Java)
 
Encapsulation
EncapsulationEncapsulation
Encapsulation
 
Encapsulation
EncapsulationEncapsulation
Encapsulation
 
Oo ps concepts in c++
Oo ps concepts in c++Oo ps concepts in c++
Oo ps concepts in c++
 
Encapsulation C++
Encapsulation C++Encapsulation C++
Encapsulation C++
 
[OOP - Lec 08] Encapsulation (Information Hiding)
[OOP - Lec 08] Encapsulation (Information Hiding)[OOP - Lec 08] Encapsulation (Information Hiding)
[OOP - Lec 08] Encapsulation (Information Hiding)
 
Single responsibility pattern
Single responsibility patternSingle responsibility pattern
Single responsibility pattern
 
object oriented programing lecture 1
object oriented programing lecture 1object oriented programing lecture 1
object oriented programing lecture 1
 
Encapsulation
EncapsulationEncapsulation
Encapsulation
 
11 interfaces
11 interfaces11 interfaces
11 interfaces
 
Presentation on oo ps 2
Presentation on oo ps 2Presentation on oo ps 2
Presentation on oo ps 2
 
Oop in kotlin
Oop in kotlinOop in kotlin
Oop in kotlin
 
It seminar-xml serialization
It seminar-xml serializationIt seminar-xml serialization
It seminar-xml serialization
 

Viewers also liked

Functional Leap of Faith (Keynote at JDay Lviv 2014)
Functional Leap of Faith (Keynote at JDay Lviv 2014)Functional Leap of Faith (Keynote at JDay Lviv 2014)
Functional Leap of Faith (Keynote at JDay Lviv 2014)Tomer Gabel
 
Maglev-A different way to develop with Ruby
Maglev-A different way to develop with RubyMaglev-A different way to develop with Ruby
Maglev-A different way to develop with RubyHernan Wilkinson
 
Avoiding to Reinvent the flat tire
Avoiding to Reinvent the flat tireAvoiding to Reinvent the flat tire
Avoiding to Reinvent the flat tireHernan Wilkinson
 
Design Pattern From Java To Ruby
Design Pattern    From Java To RubyDesign Pattern    From Java To Ruby
Design Pattern From Java To RubyRobbin Fan
 
History of computer language
History of computer languageHistory of computer language
History of computer languageClaire Punkcor
 

Viewers also liked (8)

Benefits of encapsulation
Benefits of encapsulationBenefits of encapsulation
Benefits of encapsulation
 
Design Pattern Automation
Design Pattern AutomationDesign Pattern Automation
Design Pattern Automation
 
Functional Leap of Faith (Keynote at JDay Lviv 2014)
Functional Leap of Faith (Keynote at JDay Lviv 2014)Functional Leap of Faith (Keynote at JDay Lviv 2014)
Functional Leap of Faith (Keynote at JDay Lviv 2014)
 
Chapter 4 computer language
Chapter 4 computer languageChapter 4 computer language
Chapter 4 computer language
 
Maglev-A different way to develop with Ruby
Maglev-A different way to develop with RubyMaglev-A different way to develop with Ruby
Maglev-A different way to develop with Ruby
 
Avoiding to Reinvent the flat tire
Avoiding to Reinvent the flat tireAvoiding to Reinvent the flat tire
Avoiding to Reinvent the flat tire
 
Design Pattern From Java To Ruby
Design Pattern    From Java To RubyDesign Pattern    From Java To Ruby
Design Pattern From Java To Ruby
 
History of computer language
History of computer languageHistory of computer language
History of computer language
 

Similar to Bab satu

the Concept of Object-Oriented Programming
the Concept of Object-Oriented Programmingthe Concept of Object-Oriented Programming
the Concept of Object-Oriented ProgrammingAida Ramlan II
 
Top 30 Technical interview questions
Top 30 Technical interview questionsTop 30 Technical interview questions
Top 30 Technical interview questionsSohailSaifi15
 
Chapter 04 object oriented programming
Chapter 04 object oriented programmingChapter 04 object oriented programming
Chapter 04 object oriented programmingPraveen M Jigajinni
 
Object Oriented Language
Object Oriented LanguageObject Oriented Language
Object Oriented Languagedheva B
 
1 intro
1 intro1 intro
1 introabha48
 
Object oriented programming concept
Object oriented programming conceptObject oriented programming concept
Object oriented programming conceptPina Parmar
 
A Survey of Object Oriented Programming LanguagesMaya Hris.docx
A Survey of Object Oriented Programming LanguagesMaya Hris.docxA Survey of Object Oriented Programming LanguagesMaya Hris.docx
A Survey of Object Oriented Programming LanguagesMaya Hris.docxdaniahendric
 
Features of Object Oriented Programming.pptx
Features of Object Oriented Programming.pptxFeatures of Object Oriented Programming.pptx
Features of Object Oriented Programming.pptxSwagatoBiswas
 
M.c.a. (sem iv)- java programming
M.c.a. (sem   iv)- java programmingM.c.a. (sem   iv)- java programming
M.c.a. (sem iv)- java programmingPraveen Chowdary
 
Fundamentals of oops in .Net
Fundamentals of oops in .NetFundamentals of oops in .Net
Fundamentals of oops in .NetHarman Bajwa
 
Introduction to Java -unit-1
Introduction to Java -unit-1Introduction to Java -unit-1
Introduction to Java -unit-1RubaNagarajan
 
OOP lesson1 and Variables.pdf
OOP lesson1 and Variables.pdfOOP lesson1 and Variables.pdf
OOP lesson1 and Variables.pdfHouseMusica
 

Similar to Bab satu (20)

the Concept of Object-Oriented Programming
the Concept of Object-Oriented Programmingthe Concept of Object-Oriented Programming
the Concept of Object-Oriented Programming
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented Programming
 
Top 30 Technical interview questions
Top 30 Technical interview questionsTop 30 Technical interview questions
Top 30 Technical interview questions
 
Chapter 04 object oriented programming
Chapter 04 object oriented programmingChapter 04 object oriented programming
Chapter 04 object oriented programming
 
Object Oriented Language
Object Oriented LanguageObject Oriented Language
Object Oriented Language
 
Ah java-ppt2
Ah java-ppt2Ah java-ppt2
Ah java-ppt2
 
1 intro
1 intro1 intro
1 intro
 
Object oriented programming concept
Object oriented programming conceptObject oriented programming concept
Object oriented programming concept
 
OOP
OOPOOP
OOP
 
Oops concepts
Oops conceptsOops concepts
Oops concepts
 
A Survey of Object Oriented Programming LanguagesMaya Hris.docx
A Survey of Object Oriented Programming LanguagesMaya Hris.docxA Survey of Object Oriented Programming LanguagesMaya Hris.docx
A Survey of Object Oriented Programming LanguagesMaya Hris.docx
 
Features of Object Oriented Programming.pptx
Features of Object Oriented Programming.pptxFeatures of Object Oriented Programming.pptx
Features of Object Oriented Programming.pptx
 
M.c.a. (sem iv)- java programming
M.c.a. (sem   iv)- java programmingM.c.a. (sem   iv)- java programming
M.c.a. (sem iv)- java programming
 
JAVA PROGRAMMING
JAVA PROGRAMMING JAVA PROGRAMMING
JAVA PROGRAMMING
 
Birasa 1
Birasa 1Birasa 1
Birasa 1
 
Unit 1 OOSE
Unit 1 OOSE Unit 1 OOSE
Unit 1 OOSE
 
Fundamentals of oops in .Net
Fundamentals of oops in .NetFundamentals of oops in .Net
Fundamentals of oops in .Net
 
JAVA PROGRAMMINGD
JAVA PROGRAMMINGDJAVA PROGRAMMINGD
JAVA PROGRAMMINGD
 
Introduction to Java -unit-1
Introduction to Java -unit-1Introduction to Java -unit-1
Introduction to Java -unit-1
 
OOP lesson1 and Variables.pdf
OOP lesson1 and Variables.pdfOOP lesson1 and Variables.pdf
OOP lesson1 and Variables.pdf
 

Recently uploaded

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 

Recently uploaded (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 

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

  1. 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
  2. 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.