Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Java Programming

Keywords in Java

Keywords are predefined, reserved words used in Java


programming that have special meanings to the compiler.

For example:

int score;

Here, int is a keyword. It indicates that the variable score is of integer


type (32-bit signed two's complement integer).
You cannot use keywords like int, for, class, etc as variable name (or
identifiers) as they are part of the Java programming language syntax.

Java has a total of 50 keywords, which are used to define the


syntax and structure of Java programming language.

Here's the complete list of all keywords in Java programming.

 abstract: used to declare a class or method as abstract. An

abstract class is a class that cannot be instantiated, and an

abstract method is a method without a body that must be

implemented in a subclass.

 assert: used to perform assertion testing in Java. An assertion is

a statement that should always be true, and if it is false, then

an AssertionError is thrown.

You might also like