WELCOME TO COM 123
OBJECT ORIENTED PROGRAMMING
WITH JAVA
By
Bilyaminu ABUBAKAR
LECTURE 1
Course Introduction
Agenda
1- Course Syllabus
2- Introduction to Course
Course Syllabus
Introduction To
Object-oriented Programming
Object-oriented programming (OOP) is a model organized around
objects rather than "actions" and data rather than logic.
Historically, a program has been viewed as a logical procedure
that takes input data, processes it, and produces output data.
The programming challenge was seen as how to write the logic, not how to
define the data. Object-oriented programming takes the view that what we
really care about are the objects we want to manipulate rather than the logic
requiredtomanipulatethem.
Definition:
Object-Oriented Programming is methodology or Concept to
Design a Program using Object and Class.
Why Object come first because it’s an
Object-Oriented not Class-Oriented…
General Picture of OOP
Object
Any entity that has state and behaviour is known as
an object. For example: chair, pen, table, keyboard,
bike etc.
It can be physical and logical.
Class
Collection of objects is called class. It is a logical
entity.
Inheritance
When one object acquires all the properties and behaviours of
parent object i.e. known as inheritance. It provides code
reusability. It is used to achieve runtime polymorphism.
Polymorphism
When one task is performed by different ways i.e. known as
polymorphism
In java, we use method overloading and method overriding to
achieve polymorphism.
Abstraction
Hiding internal details and showing functionality is known as
abstraction. For example: phone call, we don't know the
internal processing.
In java, we use abstract class and interface to achieve
abstraction.
Encapsulation
Binding (or wrapping) code and data together into a single unit
is known as encapsulation. For example: capsule, it is wrapped
with different medicines.
A java class is the example of encapsulation. Java bean is the
fully encapsulated class because all the data members are
private here.
Benefits of Inheritance
• One of the key benefits of inheritance is to minimize the amount of
duplicate code in an application by sharing common code amongst
several subclasses
• Inheritance can also make application code more flexible to change
because classes that inherit from a common super class can be used
interchangeably. If the return type of a method is super class
• Reusability - facility to use public methods of base class without
rewriting the same.
• Extensibility - extending the base class logic as per business logic of the
derived class

LECTURE_1_JAVA_one.pptx - COM123 Object Oriented Programming with Java by Bilyaminu Abubakar Lecture 2

  • 1.
    WELCOME TO COM123 OBJECT ORIENTED PROGRAMMING WITH JAVA By Bilyaminu ABUBAKAR
  • 2.
  • 3.
  • 4.
    Agenda 1- Course Syllabus 2-Introduction to Course
  • 5.
  • 6.
    Introduction To Object-oriented Programming Object-orientedprogramming (OOP) is a model organized around objects rather than "actions" and data rather than logic. Historically, a program has been viewed as a logical procedure that takes input data, processes it, and produces output data. The programming challenge was seen as how to write the logic, not how to define the data. Object-oriented programming takes the view that what we really care about are the objects we want to manipulate rather than the logic requiredtomanipulatethem.
  • 7.
    Definition: Object-Oriented Programming ismethodology or Concept to Design a Program using Object and Class. Why Object come first because it’s an Object-Oriented not Class-Oriented…
  • 9.
  • 10.
    Object Any entity thathas state and behaviour is known as an object. For example: chair, pen, table, keyboard, bike etc. It can be physical and logical.
  • 11.
    Class Collection of objectsis called class. It is a logical entity.
  • 12.
    Inheritance When one objectacquires all the properties and behaviours of parent object i.e. known as inheritance. It provides code reusability. It is used to achieve runtime polymorphism.
  • 13.
    Polymorphism When one taskis performed by different ways i.e. known as polymorphism In java, we use method overloading and method overriding to achieve polymorphism.
  • 14.
    Abstraction Hiding internal detailsand showing functionality is known as abstraction. For example: phone call, we don't know the internal processing. In java, we use abstract class and interface to achieve abstraction.
  • 15.
    Encapsulation Binding (or wrapping)code and data together into a single unit is known as encapsulation. For example: capsule, it is wrapped with different medicines. A java class is the example of encapsulation. Java bean is the fully encapsulated class because all the data members are private here.
  • 16.
    Benefits of Inheritance •One of the key benefits of inheritance is to minimize the amount of duplicate code in an application by sharing common code amongst several subclasses • Inheritance can also make application code more flexible to change because classes that inherit from a common super class can be used interchangeably. If the return type of a method is super class • Reusability - facility to use public methods of base class without rewriting the same. • Extensibility - extending the base class logic as per business logic of the derived class