Introduction to OOP

Lesson 10 of 20

Meet the blueprint idea behind all of Java: classes define, objects live — build your very first one step by step.

The big picture

Blueprints and living objects

Object-oriented programming mirrors the real world: classes describe things, objects are the things themselves.

Why OOP?

Real problems are full of things — cars, users, accounts. Classes let your code mirror them.

class = blueprint

A class declares fields (data) and methods (behavior). It holds no live data itself.

object = real thing

new builds an instance that owns its own copy of every field.

The big four ideas

Encapsulation, inheritance, polymorphism, abstraction — this course visits them one by one.