Difference between Class and Object in Java

Sr.No Class Object
1. The class gives the state and behavior to object. The object is a real-world entity
2. Class is a blueprint of the object The object is just an instance of the class
3. It is a logical entity It is a physical entity
4. To create a class we use the class keyword To create an object we use the new keyword
5. It is a compile-time entity

It is a runtime entity

Share