What is the difference between a class and an object in Java?
A class in Java is a blueprint or template that defines the structure and behavior of an object. An object, on the other hand, is an instance of a class, created based on that blueprint. In simple terms, a class defines what an object will contain and how it will behave, while an object is a specific instance created from that class.