Object-Oriented Programming

A bit of ad : OOP ask a effort in the beginnings ...

Java supports the Object-Oriented Programming (OOP) approach.

OOP focuses on the design of data-types (called objects or classes) rather than algorithms

Why is this distinction important?

Objects are nouns, Algorithms are verbs

If you want to put a windows in a wall, you don't say :

"Let's use a hammer to make a hole in that wall, then let's measure the size of the hole, then lets buy some piece of wood that we will put together, then ...

You say : Let's decide to have a windows in that wall

You know first what you want and then you think of the way you will get it

Which is an easier task?

isn't it easier to list the actions that you can do with a car (to buy, to sell, ...to drive°) than to list all the object you can buy ... and forget lots of them ?

What is easier?

is a relationship

with lots of "if then else" statements

Advantages of OOP