Lecture 7 - Object Oriented Programming - Part 1
Lecture 7 - Object Oriented Programming - Part 1
PROGRAMMING
LECTURE 7 – OBJECT ORIENTED PROGRAMMING
PLAN
Introduction to OOP
Class & objects
Constructor
Destructor
UML Class diagram (basic)
Turn on
Is light on?
Turn off
OOP is bottom-up
Unit 1 - Programming / Lecture 7 : OOP part 1 5
CLASS
protection
Methods
Modifiers
Modifiers Data
DataType
Type Name
Name
Chapt
Unit 1 - Programming / Lecture 7 : OOP part 1 er 4 -
8
METHOD DECLARATION
<modifier> <return type> <method name> ( <parameters> )
{
<statements>
} Modifier
Modifier Return
ReturnType
Type Method
MethodName
Name Parameter
Parameter
Client Service
private
Attributes
protected
public Methods
bike1 bike2
Sample Code
Bicycle
Bicycle( )
getOwnerName( )
setOwnerName(String)