SlideShare a Scribd company logo
2
Most read
3
Most read
12
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

PDF
Introduction to oops concepts
PPT
Object Oriented Programming Concepts
PPTX
Basic Concepts of OOPs (Object Oriented Programming in Java)
PPTX
oops concept in java | object oriented programming in java
ODP
OOP java
PPT
Object-oriented concepts
PDF
Java Basic Oops Concept
PPTX
Concept of OOPS with real life examples
Introduction to oops concepts
Object Oriented Programming Concepts
Basic Concepts of OOPs (Object Oriented Programming in Java)
oops concept in java | object oriented programming in java
OOP java
Object-oriented concepts
Java Basic Oops Concept
Concept of OOPS with real life examples

What's hot (20)

PDF
Arrays in Java
PPTX
Interface in java
PPTX
Java abstract class & abstract methods
PPTX
Control Statements in Java
PPTX
Arrays in Java
PPTX
C# classes objects
PPSX
Data Types & Variables in JAVA
PPTX
Inheritance in java
PPTX
Data types in java
PPT
Java interfaces & abstract classes
PPTX
Method overloading
PDF
Oops concepts || Object Oriented Programming Concepts in Java
PPT
Exception Handling in JAVA
PPTX
OOPS In JAVA.pptx
PPTX
Arrays in java
PPTX
Core java complete ppt(note)
PPTX
Interfaces in java
PPT
Abstract class in java
PPT
Looping statements in Java
Arrays in Java
Interface in java
Java abstract class & abstract methods
Control Statements in Java
Arrays in Java
C# classes objects
Data Types & Variables in JAVA
Inheritance in java
Data types in java
Java interfaces & abstract classes
Method overloading
Oops concepts || Object Oriented Programming Concepts in Java
Exception Handling in JAVA
OOPS In JAVA.pptx
Arrays in java
Core java complete ppt(note)
Interfaces in java
Abstract class in java
Looping statements in Java
Ad

Similar to OOP Introduction with java programming language (20)

ODP
Ayush oops
PDF
Object-Oriented Programming (OOP)
PDF
Procedural-vs-Object-Oriented-Programming (1).pdf
PPTX
Object oriented programming
PPTX
object oriented programming and methodology.pptx
PPTX
SKILLWISE - OOPS CONCEPT
PPTX
introduction of Object oriented programming
PPTX
OOP Presentation.pptx
PPTX
OOP Presentation.pptx
PDF
L1-Introduction to OOPs concepts.pdf
PPTX
Object Oriented Programming
PPTX
Basic Concepts Of OOPS/OOPS in Java,C++
PPTX
Object Oriented Programming Concepts
PPTX
Introduction to Java -unit-1
PPTX
Object oriented programming
PPTX
Intro to object oriented programming.pptx
PPTX
Concepts of oop1
PDF
Total oop in c# dot net
PPTX
Chapter 04 object oriented programming
PPTX
General oops concepts
Ayush oops
Object-Oriented Programming (OOP)
Procedural-vs-Object-Oriented-Programming (1).pdf
Object oriented programming
object oriented programming and methodology.pptx
SKILLWISE - OOPS CONCEPT
introduction of Object oriented programming
OOP Presentation.pptx
OOP Presentation.pptx
L1-Introduction to OOPs concepts.pdf
Object Oriented Programming
Basic Concepts Of OOPS/OOPS in Java,C++
Object Oriented Programming Concepts
Introduction to Java -unit-1
Object oriented programming
Intro to object oriented programming.pptx
Concepts of oop1
Total oop in c# dot net
Chapter 04 object oriented programming
General oops concepts
Ad

Recently uploaded (20)

PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Computing-Curriculum for Schools in Ghana
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
Orientation - ARALprogram of Deped to the Parents.pptx
PPTX
master seminar digital applications in india
PPTX
UNIT III MENTAL HEALTH NURSING ASSESSMENT
PDF
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PPTX
Cell Structure & Organelles in detailed.
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
STATICS OF THE RIGID BODIES Hibbelers.pdf
Practical Manual AGRO-233 Principles and Practices of Natural Farming
Final Presentation General Medicine 03-08-2024.pptx
2.FourierTransform-ShortQuestionswithAnswers.pdf
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Computing-Curriculum for Schools in Ghana
Microbial diseases, their pathogenesis and prophylaxis
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
Paper A Mock Exam 9_ Attempt review.pdf.
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
Final Presentation General Medicine 03-08-2024.pptx
Orientation - ARALprogram of Deped to the Parents.pptx
master seminar digital applications in india
UNIT III MENTAL HEALTH NURSING ASSESSMENT
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
Cell Structure & Organelles in detailed.
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3

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