Definition

Java keyword

Contributor(s): Matthew Haughn

A Java keyword is one of 50 reserved terms that have a special function and a set definition in the Java programming language. The fact that the terms are reserved means that they cannot be used as identifiers for any other program elements, including classes, subclasses, variables, methods and objects.

Keywords in the Java programming language

(See some examples of keyword functions below the table.)

abstract continue for new switch
assert default goto package synchronized
boolean do if private this
break double implements protected throw
byte else import public throws
case enum instanceof return transient
catch extends int short try
char final interface static void
class finally long strictfp volatile
const float native super while

 A few examples of Java keyword functions:

The abstract keyword, placed before class, prevents that class from being directly instantiated.

The assert keyword, placed before a true or false statement known as a predicate, indicates that the programmer believes the statement to always be true. If it proves otherwise, an assertion exception occurs.

The const keyword defines a variable or pointer as unchangeable.

 

This was last updated in July 2016

Continue Reading About Java keyword

PRO+

Content

Find more PRO+ content and other member only offers, here.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

File Extensions and File Formats

Powered by:

SearchCloudApplications

SearchSoftwareQuality

SearchFinancialApplications

SearchSAP

SearchManufacturingERP

Close