module
, requires
, and exports
are reserved keywords in module declarations and cannot be used as regular identifiers anywhere in Java code.goto
and const
are reserved keywords and cannot be used as identifiers,
although they are not currently used in Java.boolean
: Represents true/false valueschar
: Single 16-bit Unicode characterbyte
: 8-bit signed integer (-128 to 127)short
: 16-bit signed integer (-32,768 to 32,767)int
: 32-bit signed integer (-2³¹ to 2³¹-1)long
: 64-bit signed integer (-2⁶³ to 2⁶³-1)float
: 32-bit floating pointdouble
: 64-bit floating pointvoid
: Indicates that a method doesn't return any valuevar
: Local variable type inference (cannot be used for class/instance fields, method parameters, or return types)enum
: Defines a fixed set of constantsclass
: Declares a classinterface
: Declares an interfacepublic
: Accessible from anywhereprivate
: Accessible only within the same classprotected
: Accessible within package and subclassesextends
: Class inheritance (single inheritance)implements
: Interface implementation (multiple inheritance of type)abstract
: Declares abstract classes/methods (cannot be instantiated)final
: Prevents inheritance (classes), overriding (methods), or reassignment (variables)new
: Creates new object instancesthis
: Reference to current object instancesuper
: Reference to parent classinstanceof
: Tests object type at runtimestatic
: Belongs to class rather than instance (shared among all objects)native
: Method implemented in platform-specific code (JNI)volatile
: Ensures variable visibility across threads (prevents caching)transient
: Excludes field from serializationsynchronized
: Thread-safe method/block executionstrictfp
: Ensures consistent floating-point calculations across platformsif
: Conditional executionelse
: Alternative execution pathswitch
: Multi-way branchingcase
: Individual switch casesdefault
: Default case in switch statementsfor
: Counter-controlled loop (traditional and enhanced for-each)while
: Condition-controlled loop (pre-test)do
: Condition-controlled loop (post-test)continue
: Skips current iteration, continues with nextbreak
: Exits loops or switch statementsreturn
: Exits method and optionally returns valuetry
: Defines block that may throw exceptionscatch
: Handles specific exception typesfinally
: Always executes regardless of exceptionsthrow
: Explicitly throws an exceptionthrows
: Declares exceptions that method may throwimport
: Imports classes/packages for usepackage
: Declares a package namespaceassert
: Runtime assertions for debugging (must be enabled with -ea flag)