Professional Documents
Culture Documents
Presentación 2 - Objetos I
Presentación 2 - Objetos I
Agenda
Object Oriented
Approach
Objects in Java
Instantiating Objects:
A Closer Look
Abstraction
Vehicle
Truck
Lotus Elan
M100
Car
Sport
Compact
Alpine
A110
Porsche
Boxster
Bicycle
Van
Limousine
Vehicle
Truck
Car
Bicycle
Sport
Lotus Elan
M100
Alpine
A110
Porsche
Boxster
Sport car
rules
Small
Two seat
Luxury
High speed
Correct classification
Objects & Classes
Developing an
abstraction of the
problem is a
necessary first step
of all software
development.
What is OOP?
What is a object?
Physical objects
Person
Student
Professor
Conceptual objects
Class
Grade
Age
State
(data)
Abstraction of
a real-world
(physical or
conceptual)
object
Behavior
(functions)
State is a group of
objects attribute
values
Attributes are
data elements
used to describe
an object
Birth date
ID
ID: 649851
Program
Operations are
the things that
an object does
to modify its
attribute values
things that an
object does to
access its
attribute
What is a class?
Area
Perimeter
List of Angles
List of Edges
Objects
examples
Class
example
Objects in Java
Creating classes
Instantiation
Encapsulation
Attribute
Type
id
integer
name
String
surName
String
birthDate
Date
papa
double
advisor
???
courses
???
Instantiation
Type
Value
id
integer
To be determined
name
String
To be determined
surName
String
To be determined
birthDate
Date
To be determined
papa
double
To be determined
advisor
???
To be determined
courses
???
To be determined
Class definition
Objects & Classes
Instantiation
Instantiation
Encapsulation
Encapsulation
Accessor
Mutator
Encapsulation benefits
protective barrier
Where do
my
balloons
will go?
Garbage collection
Garbage collection
Class activity
References