SlideShare a Scribd company logo
3
 Object-oriented programming is a method of
implementation in which programs are organized as
cooperative collections of objects, each of which
represents an instance of some class, and whose classes
are all members of one or more hierarchy of classes united
via inheritance relationships.
What is OOP ?
Most read
13

 The sub-class inherits the base class’ data members and member
functions.
 A sub-class has all data members of its base-class plus its own.
 A sub-class has all member functions of its base class (with changes)
plus its own.
Cont’d
Most read
16

 It is achieved by using many different techniques named
method overloading and method overriding.
Cont’d
Most read
Md. Al-Imran
Lecturer
Department of Computer Science & Engineering
Dhaka International University
Bangladesh

 Define OOP
 OOP Vs. Structured Programming
 Main principle of OOP
 Encapsulation
 Abstraction
 Inheritance
 Polymorphism
 Overview
Contents
 Object-oriented programming is a method of
implementation in which programs are organized as
cooperative collections of objects, each of which
represents an instance of some class, and whose classes
are all members of one or more hierarchy of classes united
via inheritance relationships.
What is OOP ?

Structure Programming Object Oriented Programming
Top to Bottom Design Object focused design
Structure determines execution flow Conversion determines execution flow.
Moderately complex program Very Complex Program
Less data security More security
Less flexible More flexible
Less reusability More reusability
Less abstraction More abstraction
Structure Programming Vs. OOP

Reusability
Platform Independent
Security
Client/Sever Application
Graphical User Interface
Design Pattern
Portability (WORA)
Why Java?

 Write Ones Run Anywhere
WORA

 Fundamental Principles of Object Oriented Programming:
1. Encapsulation.
2. Abstraction.
3. Inheritance.
4. Polymorphism.
Main principle of OOP

 Encapsulation is the mechanism that binds together
code and the data it manipulates, and keeps both
safe from outside interference and misuse.
Encapsulation

i. Protection
ii. Consistency
iii. Allows change
Advantages of Encapsulation
 abstraction is a process of hiding the implementation
details from the user, only the functionality will be
provided to the user. In other words, the user will have the
information on what the object does instead of how it
does.
 In Java, abstraction is achieved using Abstract classes and
interfaces.
Abstraction

 An abstract class is a class that is declared with abstract keyword.
 An abstract method is a method that is declared without an
implementation.
 An abstract class may or may not have all abstract methods. Some
of them can be concrete methods.
 A method defined abstract must always be redefined in the subclass,
 Any class that contains one or more abstract methods must also be
declared with abstract keyword.
 There can be no object of an abstract class. That is, an abstract class
can not be directly instantiated with the new operator.
Abstract Class Vs. Abstract
Method

 Inheritance is the process by which one object acquires the properties
of another object.
 A class that is derived from another class is called a subclass(also a
derived class, extended class, or child class).
 The class from which the subclass is derived is called a super class
(also a base class or a parent class).
Inheritance

 The sub-class inherits the base class’ data members and member
functions.
 A sub-class has all data members of its base-class plus its own.
 A sub-class has all member functions of its base class (with changes)
plus its own.
Cont’d

Inheritance has a lot of benefits
 Extensibility
 Reusability
 Provides abstraction
 Eliminates redundant code
 Use inheritance for building a relationships
E.g. dog is--a animal (dogs are kind of animals)
Benefits of Inheritance
 Polymorphisms comes from Greek word that means 'many forms'.
 More precisely Polymorphisms means the ability to request that
the same methods be performed by a wide range of different types
of things.
Polymorphism

 It is achieved by using many different techniques named
method overloading and method overriding.
Cont’d

 Discuss about OOP.
 Differentiate Structure Programming and OOP.
 Main principles of OOP.
 Encapsulation.
 Abstraction.
 Inheritance.
 Polymorphism.
Overview
OOP Introduction with java programming language

More Related Content

What's hot (20)

Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in Python
Sujith Kumar
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
Amit Soni (CTFL)
 
Introduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingIntroduction to Object Oriented Programming
Introduction to Object Oriented Programming
Moutaz Haddara
 
OOPS In JAVA.pptx
OOPS In JAVA.pptxOOPS In JAVA.pptx
OOPS In JAVA.pptx
Sachin33417
 
Classes, objects in JAVA
Classes, objects in JAVAClasses, objects in JAVA
Classes, objects in JAVA
Abhilash Nair
 
Java abstract class & abstract methods
Java abstract class & abstract methodsJava abstract class & abstract methods
Java abstract class & abstract methods
Shubham Dwivedi
 
Object Oriented Programming Lecture Notes
Object Oriented Programming Lecture NotesObject Oriented Programming Lecture Notes
Object Oriented Programming Lecture Notes
FellowBuddy.com
 
Procedural vs. object oriented programming
Procedural vs. object oriented programmingProcedural vs. object oriented programming
Procedural vs. object oriented programming
Haris Bin Zahid
 
Introduction to Java -unit-1
Introduction to Java -unit-1Introduction to Java -unit-1
Introduction to Java -unit-1
RubaNagarajan
 
Event handling
Event handlingEvent handling
Event handling
swapnac12
 
Polymorphism in java
Polymorphism in javaPolymorphism in java
Polymorphism in java
Elizabeth alexander
 
Class and Objects in Java
Class and Objects in JavaClass and Objects in Java
Class and Objects in Java
Spotle.ai
 
Basic concept of OOP's
Basic concept of OOP'sBasic concept of OOP's
Basic concept of OOP's
Prof. Dr. K. Adisesha
 
Packages in java
Packages in javaPackages in java
Packages in java
Elizabeth alexander
 
Oops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in JavaOops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in Java
Madishetty Prathibha
 
Constructor in java
Constructor in javaConstructor in java
Constructor in java
Pavith Gunasekara
 
Java Data Types
Java Data TypesJava Data Types
Java Data Types
Spotle.ai
 
Object model
Object modelObject model
Object model
James Wong
 
[OOP - Lec 01] Introduction to OOP
[OOP - Lec 01] Introduction to OOP[OOP - Lec 01] Introduction to OOP
[OOP - Lec 01] Introduction to OOP
Muhammad Hammad Waseem
 
Chapter 05 classes and objects
Chapter 05 classes and objectsChapter 05 classes and objects
Chapter 05 classes and objects
Praveen M Jigajinni
 
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in Python
Sujith Kumar
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
Amit Soni (CTFL)
 
Introduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingIntroduction to Object Oriented Programming
Introduction to Object Oriented Programming
Moutaz Haddara
 
OOPS In JAVA.pptx
OOPS In JAVA.pptxOOPS In JAVA.pptx
OOPS In JAVA.pptx
Sachin33417
 
Classes, objects in JAVA
Classes, objects in JAVAClasses, objects in JAVA
Classes, objects in JAVA
Abhilash Nair
 
Java abstract class & abstract methods
Java abstract class & abstract methodsJava abstract class & abstract methods
Java abstract class & abstract methods
Shubham Dwivedi
 
Object Oriented Programming Lecture Notes
Object Oriented Programming Lecture NotesObject Oriented Programming Lecture Notes
Object Oriented Programming Lecture Notes
FellowBuddy.com
 
Procedural vs. object oriented programming
Procedural vs. object oriented programmingProcedural vs. object oriented programming
Procedural vs. object oriented programming
Haris Bin Zahid
 
Introduction to Java -unit-1
Introduction to Java -unit-1Introduction to Java -unit-1
Introduction to Java -unit-1
RubaNagarajan
 
Event handling
Event handlingEvent handling
Event handling
swapnac12
 
Class and Objects in Java
Class and Objects in JavaClass and Objects in Java
Class and Objects in Java
Spotle.ai
 
Oops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in JavaOops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in Java
Madishetty Prathibha
 
Java Data Types
Java Data TypesJava Data Types
Java Data Types
Spotle.ai
 

Similar to OOP Introduction with java programming language (20)

Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
mustafa sarac
 
Review oop and ood
Review oop and oodReview oop and ood
Review oop and ood
than sare
 
CS3391 Object oriented programming paradigms.docx
CS3391 Object oriented programming paradigms.docxCS3391 Object oriented programming paradigms.docx
CS3391 Object oriented programming paradigms.docx
JSEThomasR
 
Java questions for interview
Java questions for interviewJava questions for interview
Java questions for interview
Kuntal Bhowmick
 
Lecture 8
Lecture 8Lecture 8
Lecture 8
Debasish Pratihari
 
Java Interview Questions
Java Interview QuestionsJava Interview Questions
Java Interview Questions
Kuntal Bhowmick
 
1669609053088_oops_final.pptx
1669609053088_oops_final.pptx1669609053088_oops_final.pptx
1669609053088_oops_final.pptx
PandeeswariKannan
 
Oops concepts
Oops conceptsOops concepts
Oops concepts
ACCESS Health Digital
 
Oop
OopOop
Oop
Jun-jun Lagman
 
Oop concepts
Oop conceptsOop concepts
Oop concepts
Ritu Mangla
 
Suga java training_with_footer
Suga java training_with_footerSuga java training_with_footer
Suga java training_with_footer
Sugavanam Natarajan
 
Oops
OopsOops
Oops
Sankar Balasubramanian
 
The Four Pillars of Object-Oriented Programming
The Four Pillars of Object-Oriented ProgrammingThe Four Pillars of Object-Oriented Programming
The Four Pillars of Object-Oriented Programming
infoguestbloging
 
oopsinvb-191021101327.pdf
oopsinvb-191021101327.pdfoopsinvb-191021101327.pdf
oopsinvb-191021101327.pdf
JP Chicano
 
Oops in vb
Oops in vbOops in vb
Oops in vb
Dalwin INDIA
 
Object Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaionObject Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaion
Pritom Chaki
 
Java interview questions
Java interview questionsJava interview questions
Java interview questions
Shashwat Shriparv
 
introduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.pptintroduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.ppt
kaavyashruthi
 
introduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.pptintroduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.ppt
RamadossSundaramoort1
 
introduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.pptintroduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.ppt
hijat789
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
mustafa sarac
 
Review oop and ood
Review oop and oodReview oop and ood
Review oop and ood
than sare
 
CS3391 Object oriented programming paradigms.docx
CS3391 Object oriented programming paradigms.docxCS3391 Object oriented programming paradigms.docx
CS3391 Object oriented programming paradigms.docx
JSEThomasR
 
Java questions for interview
Java questions for interviewJava questions for interview
Java questions for interview
Kuntal Bhowmick
 
Java Interview Questions
Java Interview QuestionsJava Interview Questions
Java Interview Questions
Kuntal Bhowmick
 
1669609053088_oops_final.pptx
1669609053088_oops_final.pptx1669609053088_oops_final.pptx
1669609053088_oops_final.pptx
PandeeswariKannan
 
The Four Pillars of Object-Oriented Programming
The Four Pillars of Object-Oriented ProgrammingThe Four Pillars of Object-Oriented Programming
The Four Pillars of Object-Oriented Programming
infoguestbloging
 
oopsinvb-191021101327.pdf
oopsinvb-191021101327.pdfoopsinvb-191021101327.pdf
oopsinvb-191021101327.pdf
JP Chicano
 
Object Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaionObject Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaion
Pritom Chaki
 
introduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.pptintroduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.ppt
kaavyashruthi
 
introduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.pptintroduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.ppt
RamadossSundaramoort1
 
introduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.pptintroduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.ppt
hijat789
 
Ad

Recently uploaded (20)

Pfeiffer "Secrets to Changing Behavior in Scholarly Communication: A 2025 NIS...
Pfeiffer "Secrets to Changing Behavior in Scholarly Communication: A 2025 NIS...Pfeiffer "Secrets to Changing Behavior in Scholarly Communication: A 2025 NIS...
Pfeiffer "Secrets to Changing Behavior in Scholarly Communication: A 2025 NIS...
National Information Standards Organization (NISO)
 
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKANMATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
State institute of educational technology
State institute of educational technologyState institute of educational technology
State institute of educational technology
vp5806484
 
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
SweetytamannaMohapat
 
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptxPests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Arshad Shaikh
 
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
GeorgeDiamandis11
 
Black and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdfBlack and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdf
AnnasofiaUrsini
 
How to Manage Maintenance Request in Odoo 18
How to Manage Maintenance Request in Odoo 18How to Manage Maintenance Request in Odoo 18
How to Manage Maintenance Request in Odoo 18
Celine George
 
Strengthened Senior High School - Landas Tool Kit.pptx
Strengthened Senior High School - Landas Tool Kit.pptxStrengthened Senior High School - Landas Tool Kit.pptx
Strengthened Senior High School - Landas Tool Kit.pptx
SteffMusniQuiballo
 
LDMMIA Reiki Yoga S8 Free Workshop Grad Level
LDMMIA Reiki Yoga S8 Free Workshop Grad LevelLDMMIA Reiki Yoga S8 Free Workshop Grad Level
LDMMIA Reiki Yoga S8 Free Workshop Grad Level
LDM & Mia eStudios
 
la storia dell'Inghilterra, letteratura inglese
la storia dell'Inghilterra, letteratura inglesela storia dell'Inghilterra, letteratura inglese
la storia dell'Inghilterra, letteratura inglese
LetiziaLucente
 
Unit 3 Poster Sketches with annotations.pptx
Unit 3 Poster Sketches with annotations.pptxUnit 3 Poster Sketches with annotations.pptx
Unit 3 Poster Sketches with annotations.pptx
bobby205207
 
LDMMIA Reiki Yoga Next Week Grad Updates
LDMMIA Reiki Yoga Next Week Grad UpdatesLDMMIA Reiki Yoga Next Week Grad Updates
LDMMIA Reiki Yoga Next Week Grad Updates
LDM & Mia eStudios
 
LDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDMMIA Free Reiki Yoga S9 Grad Level Intuition IILDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDM & Mia eStudios
 
Coleoptera: The Largest Insect Order.pptx
Coleoptera: The Largest Insect Order.pptxColeoptera: The Largest Insect Order.pptx
Coleoptera: The Largest Insect Order.pptx
Arshad Shaikh
 
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
EduSkills OECD
 
Forestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdf
Forestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdfForestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdf
Forestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdf
ChalaKelbessa
 
Rose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdfRose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdf
kushallamichhame
 
TV Shows and web-series quiz | QUIZ CLUB OF PSGCAS | 13TH MARCH 2025
TV Shows and web-series quiz | QUIZ CLUB OF PSGCAS | 13TH MARCH 2025TV Shows and web-series quiz | QUIZ CLUB OF PSGCAS | 13TH MARCH 2025
TV Shows and web-series quiz | QUIZ CLUB OF PSGCAS | 13TH MARCH 2025
Quiz Club of PSG College of Arts & Science
 
Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...
Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...
Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...
National Information Standards Organization (NISO)
 
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKANMATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
State institute of educational technology
State institute of educational technologyState institute of educational technology
State institute of educational technology
vp5806484
 
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
SweetytamannaMohapat
 
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptxPests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Arshad Shaikh
 
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
GeorgeDiamandis11
 
Black and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdfBlack and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdf
AnnasofiaUrsini
 
How to Manage Maintenance Request in Odoo 18
How to Manage Maintenance Request in Odoo 18How to Manage Maintenance Request in Odoo 18
How to Manage Maintenance Request in Odoo 18
Celine George
 
Strengthened Senior High School - Landas Tool Kit.pptx
Strengthened Senior High School - Landas Tool Kit.pptxStrengthened Senior High School - Landas Tool Kit.pptx
Strengthened Senior High School - Landas Tool Kit.pptx
SteffMusniQuiballo
 
LDMMIA Reiki Yoga S8 Free Workshop Grad Level
LDMMIA Reiki Yoga S8 Free Workshop Grad LevelLDMMIA Reiki Yoga S8 Free Workshop Grad Level
LDMMIA Reiki Yoga S8 Free Workshop Grad Level
LDM & Mia eStudios
 
la storia dell'Inghilterra, letteratura inglese
la storia dell'Inghilterra, letteratura inglesela storia dell'Inghilterra, letteratura inglese
la storia dell'Inghilterra, letteratura inglese
LetiziaLucente
 
Unit 3 Poster Sketches with annotations.pptx
Unit 3 Poster Sketches with annotations.pptxUnit 3 Poster Sketches with annotations.pptx
Unit 3 Poster Sketches with annotations.pptx
bobby205207
 
LDMMIA Reiki Yoga Next Week Grad Updates
LDMMIA Reiki Yoga Next Week Grad UpdatesLDMMIA Reiki Yoga Next Week Grad Updates
LDMMIA Reiki Yoga Next Week Grad Updates
LDM & Mia eStudios
 
LDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDMMIA Free Reiki Yoga S9 Grad Level Intuition IILDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDM & Mia eStudios
 
Coleoptera: The Largest Insect Order.pptx
Coleoptera: The Largest Insect Order.pptxColeoptera: The Largest Insect Order.pptx
Coleoptera: The Largest Insect Order.pptx
Arshad Shaikh
 
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
EduSkills OECD
 
Forestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdf
Forestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdfForestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdf
Forestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdf
ChalaKelbessa
 
Rose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdfRose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdf
kushallamichhame
 
Ad

OOP Introduction with java programming language

  • 1. Md. Al-Imran Lecturer Department of Computer Science & Engineering Dhaka International University Bangladesh
  • 2.   Define OOP  OOP Vs. Structured Programming  Main principle of OOP  Encapsulation  Abstraction  Inheritance  Polymorphism  Overview Contents
  • 3.  Object-oriented programming is a method of implementation in which programs are organized as cooperative collections of objects, each of which represents an instance of some class, and whose classes are all members of one or more hierarchy of classes united via inheritance relationships. What is OOP ?
  • 4.  Structure Programming Object Oriented Programming Top to Bottom Design Object focused design Structure determines execution flow Conversion determines execution flow. Moderately complex program Very Complex Program Less data security More security Less flexible More flexible Less reusability More reusability Less abstraction More abstraction Structure Programming Vs. OOP
  • 5.  Reusability Platform Independent Security Client/Sever Application Graphical User Interface Design Pattern Portability (WORA) Why Java?
  • 6.   Write Ones Run Anywhere WORA
  • 7.   Fundamental Principles of Object Oriented Programming: 1. Encapsulation. 2. Abstraction. 3. Inheritance. 4. Polymorphism. Main principle of OOP
  • 8.   Encapsulation is the mechanism that binds together code and the data it manipulates, and keeps both safe from outside interference and misuse. Encapsulation
  • 9.  i. Protection ii. Consistency iii. Allows change Advantages of Encapsulation
  • 10.  abstraction is a process of hiding the implementation details from the user, only the functionality will be provided to the user. In other words, the user will have the information on what the object does instead of how it does.  In Java, abstraction is achieved using Abstract classes and interfaces. Abstraction
  • 11.   An abstract class is a class that is declared with abstract keyword.  An abstract method is a method that is declared without an implementation.  An abstract class may or may not have all abstract methods. Some of them can be concrete methods.  A method defined abstract must always be redefined in the subclass,  Any class that contains one or more abstract methods must also be declared with abstract keyword.  There can be no object of an abstract class. That is, an abstract class can not be directly instantiated with the new operator. Abstract Class Vs. Abstract Method
  • 12.   Inheritance is the process by which one object acquires the properties of another object.  A class that is derived from another class is called a subclass(also a derived class, extended class, or child class).  The class from which the subclass is derived is called a super class (also a base class or a parent class). Inheritance
  • 13.   The sub-class inherits the base class’ data members and member functions.  A sub-class has all data members of its base-class plus its own.  A sub-class has all member functions of its base class (with changes) plus its own. Cont’d
  • 14.  Inheritance has a lot of benefits  Extensibility  Reusability  Provides abstraction  Eliminates redundant code  Use inheritance for building a relationships E.g. dog is--a animal (dogs are kind of animals) Benefits of Inheritance
  • 15.  Polymorphisms comes from Greek word that means 'many forms'.  More precisely Polymorphisms means the ability to request that the same methods be performed by a wide range of different types of things. Polymorphism
  • 16.   It is achieved by using many different techniques named method overloading and method overriding. Cont’d
  • 17.   Discuss about OOP.  Differentiate Structure Programming and OOP.  Main principles of OOP.  Encapsulation.  Abstraction.  Inheritance.  Polymorphism. Overview