Java
Object-Orientated Programming Language
Foundation of Objectdefinition of a program:
Orientated
Programming
sequence of instructions that perform a particular task on a computer
program consists of a collection of interacting objects
to write a program: you need to describe different types of objects: what they can
do, how they are created, and how they interact with other objects
Objects and Classes
object: an abstraction for a real-world object
has states/attributes
class: template to create objects
when writing a program: first define classes, then create objects from
these classes to accomplish tasks
Messages and Methods
method of a class: processes a message, which can include a value or
arguments
Take a look at this piece of
code.