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.
  • It serves as a template and a logical entity.
  • The first letter of a class name should be capitalized (CamelCase), e.g., SalaryAccount.
  • Allowed special characters in a class name: $, &, _.
  • Numerical values may appear only in the middle or at the end of the class name.

Syntax

class BankDetails {
    // code
}

Object

  • An object represents state and behavior.
  • It is a physical entity used to store that state and behavior.

Syntax

BankDetails ref = new BankDetails();
  • new is a Java keyword.
  • When an object is created, the JVM allocates memory on the heap at runtime.
Back to Blog

Related posts

Read more »

SPRING BOOT EXCEPTION HANDLING

Java & Spring Boot Exception Handling Notes 1. What is Exception? Exception = unwanted situation that breaks normal flow of program. Goal of exception handling...

JDK

What is JDK? JDK is a complete software package used to develop Java applications. It contains tools to write, compile, debug, and run Java programs. When is J...