0% found this document useful (0 votes)
8 views3 pages

Java Keywords Definitions

The document provides a comprehensive list of Java keywords in alphabetical order, along with their definitions. Each keyword serves a specific purpose in Java programming, such as defining data types, control flow, exception handling, and access modifiers. This reference is useful for understanding the foundational elements of Java syntax and structure.

Uploaded by

rajyadav14032
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views3 pages

Java Keywords Definitions

The document provides a comprehensive list of Java keywords in alphabetical order, along with their definitions. Each keyword serves a specific purpose in Java programming, such as defining data types, control flow, exception handling, and access modifiers. This reference is useful for understanding the foundational elements of Java syntax and structure.

Uploaded by

rajyadav14032
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Java Keywords with Definitions (Alphabetically Ordered)

abstract – Used to declare a class or method that is incomplete and must be implemented
by subclasses.

assert – Used to test assumptions in the code; throws an error if the condition is false.

boolean – A data type that can hold only two values: true or false.

break – Exits a loop or switch statement prematurely.

byte – A data type to store 8-bit signed integers.

case – Defines individual conditions in a switch statement.

catch – Defines a block of code to handle exceptions thrown by a try block.

char – A data type that holds a single 16-bit Unicode character.

class – Used to declare a class in Java.

const – Reserved keyword, but not used in Java (present for compatibility).

continue – Skips the current iteration of a loop and jumps to the next one.

default – Defines the default block of code in a switch or a method implementation in


interfaces.

do – Used to start a do-while loop, which executes at least once.

double – A data type that stores 64-bit floating-point numbers.

else – Defines the block of code to run if the if condition is false.

enum – Defines an enumeration, a list of named constants.

exports – Declares that a module makes a package available to other modules.

extends – Indicates that a class inherits from a superclass or an interface inherits another.

final – Used to declare constants, methods that can't be overridden, or classes that can't be
extended.

finally – Defines a block that always executes after try and catch, for cleanup operations.

float – A data type for 32-bit floating-point numbers.

for – Starts a for loop for iterating over values.

goto – Reserved keyword, but not used in Java (for compatibility).


if – Executes a block if the condition is true.

implements – Indicates that a class implements an interface.

import – Allows use of classes and packages from other packages.

instanceof – Tests if an object is an instance of a specific class or subclass.

int – A data type that stores 32-bit signed integers.

interface – Declares an interface, a contract of methods without implementation.

long – A data type that stores 64-bit signed integers.

module – Declares a named module in Java's module system.

native – Specifies that a method is implemented in native (non-Java) code.

new – Allocates memory for new objects.

null – A literal representing the absence of a value or object reference.

open – Opens a module for deep reflection.

opens – Opens a package to specific modules for reflection.

package – Defines the namespace or location of a class.

private – An access modifier; the member is accessible only within the class.

protected – Allows access within the same package and subclasses.

provides – Used in module declaration to define service implementations.

public – Access modifier; allows access from any class.

requires – Declares module dependencies.

return – Exits a method and optionally returns a value.

short – A data type that stores 16-bit signed integers.

static – Declares class-level members shared by all instances.

strictfp – Ensures floating-point calculations follow IEEE 754 standard.

super – Refers to the parent class of the current object.

switch – Executes one block of code based on the value of a variable.

synchronized – Ensures that a method or block is thread-safe.


this – Refers to the current object instance.

throw – Used to throw an exception manually.

throws – Declares exceptions that a method might throw.

to – Used in module declarations to define accessibility.

transient – Prevents a field from being serialized.

transitive – Specifies a required module’s dependencies are also required.

true – A literal Boolean value representing truth.

try – Starts a block to test code for exceptions.

uses – Declares a service used by a module.

var – Declares local variables with inferred type.

void – Specifies that a method doesn’t return a value.

volatile – Ensures visibility and ordering of a variable among threads.

while – Starts a while loop; runs as long as condition is true.

yield – Returns a value from a switch expression.

You might also like