oop lecture 1_v_2

66
MAKING COMPONENTS Learning Outcomes At the end of this topic, the student is able to :- i. Describe principle of object oriented ii. Tells the difference between objects and classes iii.Reusing classes through inheritance and polymorphism >> Lecture 1 BITP 3113 Object Oriented Programming Sem I 2012/2013 Auhtored by Emma McKay-Fikri I. OBJECT ORIENTED PRINCIPLES

Upload: mohd-ruzaini-arshad

Post on 29-Jun-2015

249 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Oop lecture 1_v_2

MAKING COMPONENTS

Learning OutcomesAt the end of this topic, the student is able to :-i. Describe principle of object orientedii. Tells the difference between objects and classesiii. Reusing classes through inheritance and polymorphism

>>

Lectu

re 1

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

I. OBJECT ORIENTED PRINCIPLES

Page 2: Oop lecture 1_v_2

BEFORE WE STARTPre Requisite

>>

Lectu

re 1

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

2

Page 3: Oop lecture 1_v_2

Pre Requisite of this Chapter

• You should know what is entity• You should know how to define and write

functions• You should know how function works

>>

Lectu

re 1

3BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 4: Oop lecture 1_v_2

PILLARS OF OBJECT ORIENTED

Lesson 1

>>

Lesso

n 1

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

4

Page 5: Oop lecture 1_v_2

Principles of Object Oriented

• Identify classes, object and relationships

1. Abstraction

• Hiding information

2. Encapsulation

• Extending class definition

3. Inheritance

• Using the same name with different behavior

4. Polymorphism

>>

Lesso

n 1

5BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 6: Oop lecture 1_v_2

REPRESENTING OBJECTLesson 2

>>

Lesso

n 2

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

6

Page 7: Oop lecture 1_v_2

1. Abstraction

• Abstraction is an act to represent real world object into software component.

• It is a process to identify objects and classes for the system.

>>

Lesso

n 2

7BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 8: Oop lecture 1_v_2

Object

• Object is the main component in object oriented programming.

• An object can be considered as a “thing” that will do a set of related activities

>>

Lesso

n 2

8BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 9: Oop lecture 1_v_2

Can You Identify Objects?>

> Le

sson 2

9BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 10: Oop lecture 1_v_2

How to Identify Object?

• Object has Identity– What makes an object different from another object?

• Object has State/ Characteristic– What is the data of the object?

• Object has Behavior– What the object can do?– What can we do with the object?

>>

Lesso

n 2

10

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 11: Oop lecture 1_v_2

Object Representation in UML>

> Le

sson 2

11

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Alf Green Turtle

4 legsHard shell50 years old54 degree 33’ North

SwimTalkFlapping legs

Identity

State

Behavior

Page 12: Oop lecture 1_v_2

Objects in Nemo’s World>

> Le

sson 2

12

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Alf Green Turtle4 legsHard shell50 years old54 degree 33’ NorthSwimTalkFlapping legs

Blue Dotted StingrayTwo eyesThin flexible tailSwimTalkMoving tail

Sydney BridgeMetalish Grey4 pillarsHalf-moon archChange colorResize

Young Green Turtle4 legsHard shell6 years oldSwimTalkFlapping legs

Simon Angle FishStripes Blue Yellow2 whiskersSwimTalkMoving tail

Page 13: Oop lecture 1_v_2

Types of Object

Tangible• Physical existence can

be felt or seen• Example

Intangible• Physical existence

cannot be felt or seen • Example

Conceptual• Derived from tangible

object• Example

>>

Lesso

n 2

13

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Pull down force Box AMass 20kgAcceleration 60mphCalculate force

Thinking JavaBruce Eckel300 pagesISBN 787887547INR 6000OpenCloseDisplayDiscount

MyQueue7 elementsFirst : 16Last : 20PushPopView

Page 14: Oop lecture 1_v_2

Defining a Class

• In object oriented programming,– Objects are created– Classes are defined

• Object is an instance of a class

• A class is a general definition for a group of objects that has similar characteristics and behavior.

>>

Lesso

n 2

14

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 15: Oop lecture 1_v_2

Defining Class>

> Le

sson 2

15

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Fish

ColorLengthNamePosition

Swim()Talk()MoveEyes()MoveLips()

Many objects

One class

Page 16: Oop lecture 1_v_2

Can You Identify Classes?>

> Le

sson 2

16

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 17: Oop lecture 1_v_2

Class Representation in UML>

> Le

sson 2

17

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Fish

ColorLengthNamePosition

Swim()Talk()MoveEyes()MoveLips()

Class name

Instance variables

Methods

Compartment for instance variables and methods can be hide

Page 18: Oop lecture 1_v_2

Designing a Class

• A class must have a Name– What is the unique name for a group of object?

• A class should have Instance variables– What the class should know?– What is the data or attribute of the class?

• A class should have Method– How to class act and react?– What is the name of the action and reaction?

>>

Lesso

n 2

18

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 19: Oop lecture 1_v_2

It Comes in a Package!

• If you notice, instance variables and methods are packaged together in a class.

• This is because it is not logical to separate data/information and method/functions from a class.– Because in real world, data and functions are not

separated into different packages.

• The class model must reflects the real world entity.

>>

Lesso

n 2

19

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 20: Oop lecture 1_v_2

Real World is Complex

• Real world object vary in complexity• Some objects has similar behavior but not the same

– Lamp (on, off, turnOn, turnOff)

– Radio (on, off, frequency, volume, turnOn, turnOff, tuning, increaseVolume, decreaseVolume)

• Some objects are extended from another object– Student (name, cgpa, takeExam())

– PostGraduate (researchArea, supervisor, presentProgress())• PostGraduate is an extended class from student

• Some objects contains another objects– Car (name, model, door, color, engine)

– Engine (model, capacity)• Engine is an object resides in a car

>>

Lesso

n 2

20

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 21: Oop lecture 1_v_2

HIDING DETAILSLesson 3

>>

Lesso

n 3

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

21

Page 22: Oop lecture 1_v_2

Objects Communication

• Object does not work in isolation.• One object will be communicating with

other objects to make the application works.

• Object communicates by exchanging messages.– That is invoking behavior (or methods in a class)

• Since other objects can have an access to data and/or method in other objects, we need to have some kind of protection for a sensitive data.

>>

Lesso

n 3

22

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 23: Oop lecture 1_v_2

2. Encapsulation

• Encapsulation is hiding information from the world.

• The world do not need to know the details of the class and how it works.

• What the world need to know is what the class offers to the world to make the application works.

>>

Lesso

n 3

23

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 24: Oop lecture 1_v_2

Designing Encapsulation

• Encapsulation limits external class access to a particular class

• This can be achieve by defining the access right to instance variables and methods.

• Access right is a grant given to external class having an access to instance variables and method.

>>

Lesso

n 3

24

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 25: Oop lecture 1_v_2

Access Rights

Public Protected

Package Private

>>

Lesso

n 3

25

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 26: Oop lecture 1_v_2

UML Notation for Access Rights

Public +

Protected #

Package ~

Private -

>>

Lesso

n 3

26

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 27: Oop lecture 1_v_2

Position of Access Rights>

> Le

sson 3

27

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

public

protected

package

private

Accessible to the world

Not accessible to the world

Page 28: Oop lecture 1_v_2

Implication of Public Access Rights

• Public access rights means the world can have direct access to the instance variables and/method.

• Public instance variables allow the external class to access and modify the value.– This can be very dangerous. Sensitive data must have

some kind of protection.

• Public methods allow the external class to invoke them.

>>

Lesso

n 3

28

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 29: Oop lecture 1_v_2

Accessing Public Members

• The Aquarium can change the Color of the Fish– This is so wrong in real world. We can’t change the color of the

fish!!!– We need to protect the Color of the Fish

>>

Lesso

n 3

29

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Fish

+Color+Length+Name+Position

+Swim()+Talk()+MoveEyes()+MoveLips()

Aquarium

LengthWidthHeightWater

FillWater()FIllOxygen()AddFish()

Page 30: Oop lecture 1_v_2

Accessing Public Members

• The Aquarium can make the Fish swim() – because it is public– We make the fish swims in the aquarium

>>

Lesso

n 3

30

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Fish

+Color+Length+Name+Position

+Swim()+Talk()+MoveEyes()+MoveLips()

Aquarium

LengthWidthHeightWater

FillWater()FIllOxygen()AddFish()

Page 31: Oop lecture 1_v_2

Implication of Private Access Rights

• Private access right means the world do not have an access to the instance variables and/or methods.

• Private instance variables and methods are accessible to other members of the class.

• Normally, we protect sensitive data (instance variable) using private access rights.

>>

Lesso

n 3

31

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 32: Oop lecture 1_v_2

Accessing Private Members

• The Aquarium cannot make the Fish swim() – because it is private

>>

Lesso

n 3

32

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Fish

-Color-Length-Name-Position

-Swim()-Talk()+MoveEyes()+MoveLips()

Aquarium

LengthWidthHeightWater

FillWater()FIllOxygen()AddFish()

X

X

Page 33: Oop lecture 1_v_2

Accessing Private Members

• Private members are accessible within internal class members only

>>

Lesso

n 3

33

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Fish

-Color-Length-Name-Position

-Swim()-Talk()+MoveEyes()+MoveLips()

Aquarium

LengthWidthHeightWater

FillWater()FIllOxygen()AddFish()

Page 34: Oop lecture 1_v_2

Other Access Rights

• Protected and package will be addressed in later part of this subject

>>

Lesso

n 3

34

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 35: Oop lecture 1_v_2

INHERITANCELesson 4

>>

Lesso

n 4

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

35

Page 36: Oop lecture 1_v_2

3. Extending Class Definition

• Object oriented promotes higher reusability

• This can be achieved through inheritance

• Inheritance is extending a class definition using existing class.– No re-definition (re-writing) is required

• The new class may have additional instance variables and/or methods.

>>

Lesso

n 4

36

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 37: Oop lecture 1_v_2

Designing Inheritance

• Inheritance is design in hierarchical form which users subclass and superclass.

• Superclass is more general and can be the existing class.

• Subclass is a specialized class with additional instance variables and/or methods.

• Superclass can be derived when common instance variables and methods exist among classes.

>>

Lesso

n 4

37

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 38: Oop lecture 1_v_2

Designing Inheritance

• Shark inherits from Fish– Shark is-a Fish (Term of relationship for inheritance in

OO model)

>>

Lesso

n 4

38

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Fish

-Color-Length-Name-Position

-Swim()-Talk()+MoveEyes()+MoveLips()

Shark

-SharpTeeth

+LaughLikeEvil()

Page 39: Oop lecture 1_v_2

Relating Subclass and Superclass

• In UML, relating subclass and superclass is using solid arrow head.

• The arrow will be pointing to the superclass.

• The subclass will be at the other end.

>>

Lesso

n 4

39

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 40: Oop lecture 1_v_2

Designing Inheritance>

> Le

sson 4

40

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Fish

-Color-Length-Name-Position

-Swim()-Talk()+MoveEyes()+MoveLips()

Shark

-SharpTeeth

+LaughLikeEvil()

Superclass

Subclass

Page 41: Oop lecture 1_v_2

Inheritance

• The subclass inherits all instance variables and/or methods from superclass.– Applies to non private only– What the superclass can do, the subclass can do as

well

• This means, subclass can have a direct access to all instance variables and/or methods which are not private.

• However, superclass do not have an access to any members in subclass.

>>

Lesso

n 4

41

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 42: Oop lecture 1_v_2

Inheritance

• The Shark can Swim(), Talk(), MoveEyes() and MoveLips().• However, the Fish cannot LaughLikeEvil() and do not have

SharpTeeth

>>

Lesso

n 4

42

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Fish

-Color-Length-Name-Position

-Swim()-Talk()+MoveEyes()+MoveLips()

Shark

-SharpTeeth

+LaughLikeEvil()

Page 43: Oop lecture 1_v_2

Not a Camouflaging

• A subclass object can be a super class object– Because a sub class inherits (almost all) properties /

member from super class

• However, a superclass cannot be a subclass– Because a superclass is not inheriting and having an

access to sub class properties/member.

>>

Lesso

n 4

43

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 44: Oop lecture 1_v_2

Degree of Inheritance

• Inheritance comes in two fashion– Multiple inheritance

– Multilevel inheritance

>>

Lesso

n 4

44

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 45: Oop lecture 1_v_2

Multiple Inheritance

• A subclass is having multiple inheritance when it has two or more superclass.

• The subclass inheriting all features from multiple super classes.

>>

Lesso

n 4

45

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 46: Oop lecture 1_v_2

Designing Multiple Inheritance

• The Aeroplane inheriting the features from the FlyingObject and the Transportation.– It makes the Aeroplane can fly and used by human to

>>

Lesso

n 4

46

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

FlyingObject Transportation

Aeroplane

Page 47: Oop lecture 1_v_2

Multilevel Inheritance

• Mobilephone inherits features from Telephone.

• Smartphone inherits features from Mobilephone.

*** Thus, Smartphone is also inheriting features from Telephone ***

>>

Lesso

n 4

47

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Telephone

Mobilephone

Smartphone

Page 48: Oop lecture 1_v_2

SAME DIFFERENTLesson 5

>>

Lesso

n 5

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

48

Page 49: Oop lecture 1_v_2

How Does The Object Moves?>

> Le

sson 5

49

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 50: Oop lecture 1_v_2

Object Moves

• Turtle – flapping their legs• Fish – swims (moving the body, tail, fin)• Seahorse – using its tiny fin?• Blowfish – floating• Jellyfish – moving the legs• Bird – paddling using legs, flying

>>

Lesso

n 5

50

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 51: Oop lecture 1_v_2

4. Polymorphism

• Notice that all the objects can move• However, the way it moves are different

• This is known as polymorphism– Same name but different mechanism

>>

Lesso

n 5

51

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 52: Oop lecture 1_v_2

Implementing Polymorphism

• In programming, polymorphism is implemented using two approaches.– Method overriding– Method/constructor overloading

• Note : Details of constructor will be covered in the later part of this subject

>>

Lesso

n 5

52

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 53: Oop lecture 1_v_2

Objects Behavior

• Objects acts and reacts in the environment– This is known as object behavior

• In programming, object behavior is translated into method.

>>

Lesso

n 5

53

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 54: Oop lecture 1_v_2

Method Signature

• Objects communicate through message passing.

• Message that is to be pass contains the name of the message and data.

• Message name and data is translated into programming and known as method signature.

• Method signature is referring to the 1. method name, 2. list of parameters, 3. access right and 4. return type.

>>

Lesso

n 5

54

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 55: Oop lecture 1_v_2

Method Signature

• Note: Parameter consist of data type and name of parameter

>>

Lesso

n 5

55

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

public boolean swim (double angle, String direction) {

// insert method implementation here

return true;}

1 23 4

Page 56: Oop lecture 1_v_2

Method Overriding

• This approach is achievable through inheritance only.

• Method overriding is method with the same name and signature but different implementation.– Access right could be different

• Subclass is overriding method define in super class.

>>

Lesso

n 5

56

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 57: Oop lecture 1_v_2

Shark inherits from Fish>

> Le

sson 5

57

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Fish

-Color-Length-Name-Position

+Swim()+Talk()+MoveEyes()+MoveLips()

Shark

-SharpTeeth

+LaughLikeEvil()+ Swim()

Overridden method

Page 58: Oop lecture 1_v_2

Implementation of Method in Fish>

> Le

sson 5

58

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Fish

-Color-Length-Name-Position

+Swim()+Talk()+MoveEyes()+MoveLips()

/* The following method display angle and direction */

public boolean swim (double angle, String direction) {

System.out.print(“Move to “ + direction); System.out.println(“with angle “, angle);

return true;}

Page 59: Oop lecture 1_v_2

Implementing Method Overriding>

> Le

sson 5

59

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

/* This method change the direction of the angle by 30 degree and change the direction value */

public boolean swim (double angle, String direction) {

if (angle <= 90) angle += 90;

else angle -= 90;

if (direction.equals(“West”)direction = “East”;

System.out.println(“New direction = “ + direction); System.out.println(“New angle = “ + angle); return true;}

Shark

-SharpTeeth

+LaughLikeEvil()+ Swim()

Page 60: Oop lecture 1_v_2

Method Overloading

• Method overloading is methods that have the same name with different signature and different implementation.– Return type could be different.

• Overloaded methods are defined in the same class.

>>

Lesso

n 5

60

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 61: Oop lecture 1_v_2

Implementing Method Overloading>

> Le

sson 5

61

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Shark

-SharpTeeth

+LaughLikeEvil()+ Swim()+ ChangeColor(Color:String)+ChangeColor(Red:int, Blue: int, Green:int)

Overloaded methods

Page 62: Oop lecture 1_v_2

Implementing Method Overloading>

> Le

sson 5

62

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

/* This method change the Color of the shark */ public void changeColor(String color) { this.color = color;}

/* This method change the Color of the shark using RGB value */ public void changeColor(int red, int blue, int green) { this.color.RED = red; this.color.BLUE = blue; this.color.GREEN = green;}

Page 63: Oop lecture 1_v_2

No Re-Writing

• Inheritance and polymorphism provides higher degree of reusability.

• An advanced definition of a class (from existing) requires no re definition from base instance variables or methods (no re-writing).

• The new class can be extended from existing class.– Less hassle, maintainable and stable

>>

Lesso

n 5

63

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 64: Oop lecture 1_v_2

Common Understanding

• Method overloading enriched the model, which the same method is able to process different kinds of input data.

• This has increase the reusability of the design using common name.

>>

Lesso

n 5

64

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 65: Oop lecture 1_v_2

What Have You Learn Today?

Learning Outcomes Check Yourself Checked

i. Describe principles of object oriented

i. What are the principles of OO?

ii. Tells the difference between objects and classes.

i. What are the characteristics of objects?

ii. What are the characteristics of class?

iii. Give examples of objects and classes.

iii. Reusing classes through inheritance and polymorhphism

i. How does inheritance and polymorphism provides higher degree of reusability?

>>

Lectu

re 1

65

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

Page 66: Oop lecture 1_v_2

THAT’S WRAP FOR TODAYSee You in the Next Class

>>

Lectu

re 2

BITP 3113 Object Oriented ProgrammingSem I 2012/2013 Auhtored by Emma McKay-Fikri

66