Lecture 12
Lecture 12
Introduction to Computer
Programming for Engineering
WHAT IS OOP?
1
2/8/2012
What is a OOP?
Programming Paradigm
2
2/8/2012
WHAT IS AN OBJECT?
3
2/8/2012
What is an Object?
FUNDAMENTAL
CONCEPTS
4
2/8/2012
Class
Class
5
2/8/2012
Class
• Characteristics
Properties • Attributes
• Behaviors
Methods • Functions /
Operations
Class
For example, the class Dog would consist
of traits shared by all dogs such as:
◦ breed and fur color (properties)
◦ the ability to bark and sit
(methods/behavior).
6
2/8/2012
Instance
Instance
7
2/8/2012
Method
Method is a set of procedural statements
for achieving the desired result.
It performs different kinds of operations
on different data types.
In a programming language, methods
(sometimes referred to as "functions") are
verbs.
Method
Akamaru, being a Dog, has the ability to
bark. So bark() is one of Akamaru's
methods.