Java OOP: Class and Object
Class
• A class in Java is a blueprint for creating objects.
• It defines attributes (fields) and behaviors (methods).
• Syntax: class ClassName { // fields // methods }
Object
• An object is an instance of a class.
• Objects are created using the 'new' keyword.
• Each object has its own identity, state, and behavior.