Day-3 details of Class and Object
Published: (January 30, 2026 at 09:05 AM EST)
1 min read
Source: Dev.to
Source: Dev.to
Class
- Class is a Java keyword
- Class is a template
- Class is a logical entity
- First letter of the class name should be capital (CamelCase), e.g.,
SalaryAccount - In a class name you can use the following special characters:
$,&,_ - Numerical values may be used only in the middle or at the end of the class name
Syntax
class BankDetails {
// code
}
Object
- Object represents state and behavior
- Object is a physical entity
- Objects are used to store state and behavior
Syntax
BankDetails ref = new BankDetails();
newis a Java keyword- When an object is created, the JVM allocates memory on the heap at runtime.