A Trip to Objects and Classes
You simply understand Java Objects and Classes
Hello everyone, In this article, you will learn about Java Objects and Classes.
What is an Object in Java?
if we consider the real world, we can find objects around us. Examples, computer, car, dog, human, book, bag etc. All these objects have states and behavior.
if we consider a dog's state is colour, name, breed and its behaviour is barking, running, wagging.
Then Object is an entity that has state and behaviour. An object has an identity. it’s typically implemented in Unique id.
An Object is an instance of the class. A class template from which objects are created.
What is a Class in Java?
A class is a blueprint from which individual objects are created.
Syntax of the class
class <class_name>{
field;
method;
}
Thinking about Objects
Instance Variables of Java
Things an object knows about itself are called Instance Variables.
Methods of Java
Things an object can do are called methods.
Look at this picture you can better understand it.

What’s the difference between a class and an Object
A class is not an object. The object is used to create a class. It tells the JVM how to make an object of that particular type. Each object made from that class can have a value for the instance variable.
Let’s make your first Object
You need two classes. one is a type of object you want to use. for example Dog, Book, Computer etc.) and another class is the tester class where you put the main method. The main method you created and access objects of your new class type
Look at the example
1. write your class

2. Write the tester class whose name <someClassName>TestDrive to test your objects. For example, if you make a dog class. you will need DogTestDrive class

3. You can create an object and access the object’s variables and methods.

Let’s check your knowledge.
Put your answers to these questions and check the answers

Answers.

Conclusion
I hope, in this article, you go trip with me to know about objects and classes. I will cover Java in upcoming articles. stay on with me.
Reference
Bates, B. and Sierra, K., 2005. Head First Java, 2nd Edition. [S.l.]: O’Reilly Media, Inc.