Java v20 Keywords
Java v20 Keywords
Keyword Definition
A Java(TM) programming language keyword used in a class definition to specify that a class
abstract is not to be instantiated, but rather inherited by other classes. An abstract class can have
abstract methods that are not implemented in the abstract class, but in subclasses.
Refers to an expression or variable that can have only a true or false value. The Java(TM)
boolean
programming language provides the boolean type and the literal values true and false.
byte A sequence of eight bits. The Java(TM) programming language provides a corresponding
byte type.
char A Java(TM) programming language keyword used to declare a variable of type character.
const This is a reserved Java(TM) programming language keyword. However, it is not used by
current versions of the Java programming language.
A Java(TM) programming language keyword used to resume program execution at the end
continue of the current loop. If followed by a label, continue resumes execution where the label
occurs.
1-4 Fundamentals of Java Programming v 2.0 – Keywords Copyright 2004, Cisco Systems, Inc.
A Java(TM) programming language keyword optionally used after all case conditions in
Default a switch statement. If all case conditions are not matched by the value of the switch
variable, the default keyword will be executed.
A Java(TM) programming language keyword used to declare a loop that will iterate a
do
block of statements. The loop's exit condition can be specified with the while keyword.
double A Java(TM) programming language keyword used to define a variable of type double.
Class X extends class Y to add functionality, either by adding fields or methods to class
extends Y, or by overriding methods of class Y. An interface extends another interface by
adding methods. Class X is said to be a subclass of class Y.
A Java(TM) programming language keyword. You define an entity once and cannot
change it or derive from it later. More specifically, a final class cannot be subclassed,
final
a final method cannot be overridden and a final variable cannot change from its
initialized value.
float A Java(TM) programming language keyword used to define a floating point number
variable.
goto This is a reserved Java(TM) programming language keyword. However, it is not used by
current versions of the Java(TM) programming language.
implements A Java(TM) programming language keyword optionally included in the class declaration
to specify any interfaces that are implemented by the current class.
A Java(TM) programming language keyword used at the beginning of a source file that
import can specify classes or entire packages to be referred to later without including their
package names in the reference.
instanceof A two-argument Java(TM) programming language keyword that tests whether the run-
time type of its first argument is assignment compatible with its second argument.
int A Java(TM) programming language keyword used to define a variable of type integer.
long A Java(TM) programming language keyword used to define a variable of type long.
2-4 Fundamentals of Java Programming v 2.0 – Keywords Copyright 2004, Cisco Systems, Inc.
A Java(TM) programming language keyword that is used in method declarations to
native specify that the method is not implemented in the same Java source file, but rather in
another language.
package A group of types. Packages are declared with the package keyword.
return A Java(TM) programming language keyword used to finish the execution of a method. It
can be followed by a value required by the method definition.
short A Java(TM) programming language keyword used to define a variable of type short.
A Java(TM) programming language keyword used to evaluate a variable that can later
switch be matched with a value specified by the case keyword in order to execute a group of
statements.
synchronized A keyword in the Java(TM) programming language that, when applied to a method or
code block, guarantees that at most one thread at a time executes that code.
A Java(TM) programming language keyword that allows the user to throw an exception
throw
or any class that implements the "throwable" interface.
3-4 Fundamentals of Java Programming v 2.0 – Keywords Copyright 2004, Cisco Systems, Inc.
A keyword in the Java(TM) programming language that indicates that a field is not part of the
Transient serialized form of an object. When an object is serialized, the values of its transient fields are
not included in the serial representation, while the values of its non-transient fields are
included.
A Java(TM) programming language keyword that defines a block of statements that may
throw a Java language exception. If an exception is thrown, an optional catch block can
try
handle specific exceptions thrown within the try block. Also, an optional finally block will
be executed regardless of whether an exception is thrown or not.
A Java(TM) programming language keyword used in method declarations to specify that the
void
method does not return any value. void can also be used as a nonfunctional statement.
volatile A Java(TM) programming language keyword used in variable declarations that specifies that
the variable is modified asynchronously by concurrently running threads.
while A Java(TM) programming language keyword used to declare a loop that iterates a block of
statements. The loop's exit condition is specified as part of the while statement.
4-4 Fundamentals of Java Programming v 2.0 – Keywords Copyright 2004, Cisco Systems, Inc.