--Originally published at Alan TC201
To explain an object in programing is easy to link it to real word things that have state and behavior, for example a videogame console, this object has different states like color, name or weight and has behavior like turn on and off, run games, movies, browse internet, etc.
Software objects have a very similar way to see them. An object stores its state in attributes and exposes its behavior through methods. Methods will tell how the object will behave while interacting with another object and attributes will tell the stats of that object.
Everything can be an object, and maybe you have different objects with states and behaviors in commun, so to not get confused you need to give to the object a CLASS to differentiate from other things,and you can have an infifite number of classes put together
For example, taking the video game console again, you need a way to have the methods and states put together. You can have a class that its only about each brand of each console like a class named Nintendo, Sony, Microsoft and PC and inside that class put another class that refers specifically to home console and portable consoles.
Class Nintendo:
Methds and stats of this class
Sub class Portable: Methds and stats of this class
Classes are blueprints that are going to tell everything about the object, and this is the first thing to know about Java.
To see more info here’s a link to more deatels: https://docs.oracle.com/javase/tutorial/java/concepts/object.html