Java Class and Objects


Java is an object-oriented programming (OOP) language. It allows you to divide complex problems into smaller sets by creating objects.

These objects share two characteristics: 

  • state
  • behavior

Let's take few examples:

  1. Laptop is an object
    • It can be in on or off state.
    • You can turn on and turn off lamp (behavior).
  2. Bicycle is an object
    • It has current gear, two wheels, number of gear etc. states.
    • It has brakingaccelerating, changing gears etc. behavior.

Recommended reading: What is an object?