3. Class
In OO model, some of the objects
exhibits identical characteristics
(information structure and
behavior)
Structure that contains common
data and function as entity for
object
Dyah Fajar Nur Rohmah
4. Object
Instance of classes
A person, place or concept
Has attributes, state and behavior
Interact sending message to each
other
Dyah Fajar Nur Rohmah
5. Example - Class
Dimas studies mathematics
Femy studies software engineering
Ganang studies computer science
Each one is a Student
These are called object of the
Student class
Dyah Fajar Nur Rohmah
7. Declaration of an object
class Rectangle {
int width;
int height;
public void set
(int w, int l){
}
}
main() {
Rectangle rect1;
Rectangle rect2;
rect1.set(4,9);
rect2.set(5,8);
}
Rect1 → width = 4
and length = 9
Rect2 → width = 5
and length = 8
Dyah Fajar Nur Rohmah