You are on page 1of 24

By: De Rosal, Ign. Moses S.

Evolution of Programming Languages


Class VS Object
What is a Class?
What is a Object?
State
Behavior
OOP Advantages
By: De Rosal, Ign. Moses S.

(A)

(B)

A class is the blueprint from which


individual objects are created.
They all have state and behavior .

Objects are key to understanding objectoriented technology.


They all have behavior and state with value.
Example of object:

Dogs have state :


name,
type,
color,
age,
eye

Cars have state :


merk,
type,
color,
years of production,
width,
height

Dogs have behavior:


barking,
fetching,
running,
sleeping

Cars have behavior :


change gear,
speed up,
applying brakes

Class dog
age

State

color

barking

running

behavior

Object coco (dog)


age=3
color=white

Instance
State

barking

running

Instance
behavior

Variable yang mengitari class, dengan nilai


datanya bisa ditentukan di object.
Name, age, dan color are state of class Dog
Class Dog
Name: string
Age: integer
Color: String

Obj Dog
Coco
3
white

Obj Dog
Bubu
4
brown

By: De Rosal, Ign. Moses S.

Behavior is implementation of how to class


work.
Bahavior can:
1. Manipulating data
2. Perform mathematical calculations
3. Monitoring an event

Abstraction
Encapsulations
Inheritence
Polymorfism

Search on google about OOP Advantages


(Abstraction and Encapsulation)
Make a summary of Class, Object, OOP Advantages
(Abstraction and Encapsulation) with your
sentences.
Give an example.
Write in a folio with handwriting.
Deadline next meeting.

You might also like