You are on page 1of 14

Object-Oriented

Programming
Lecture 1
Prepared by: Ms. Roda Flor Andrea B. Teodocio
Reference: www.udacity.com
Outline
Introduction
01

What is OOP?
02

Fields
03

Methods
04
Course Objectives

At the end of the lesson, the students are expected to:

Identify the different approaches in


writing computer programs

Define OOP

Describe each concept of OOP


Programming Paradigm

There are two most common approaches to writing computer


programs. These are:

1. Procedural programming

2. Object-oriented programming
Procedural Programming

Procedural programming is a style of programming in which the


programming task is broken down into a series of operations (called
procedures) applied to data (or data structures).

Examples of procedural programming languages are C and Pascal.


Object-Oriented Programming

What is OOP? What more? Examples

Object-oriented This may be


programming considered as an
breaks down a extension of Languages that
programming procedural support OOP are
programming in
task into a series that the actions C#, Java, C++,
of interactions performed by each Python, and
among different object are Smalltalk.
entities or specified by
objects. procedures.
Fields
Fields of an object are all the data variables that make up that object

These fields
are usually Then a library
They are also For example a
made up of object may
sometimes book object
primitive types contain a field
referred to as may contain
like integers or named books
attributes or fields like title,
characters, but that will store
member author and
they can also all book objects
variables. numOfPages.
be objects in an array.
themselves.
Accessing fields:
Fields of an object are all the data variables that make up that object
Accessing fields: (cont’d)
Fields of an object are all the data variables that make up that object
Setting fields:
Fields of an object are all the data variables that make up that object
Methods

You might have also noticed that running


actions in objects look very much like
calling a function. That’s because that’s
exactly what it is.

Methods in Java are functions that


belong to a particular object. When we
get to creating our own object types later
in this lesson we will be creating methods
the same way we used to created
functions.
Calling a Method
Summary

You might also like