|
Do you need help with your Java programming?
Click here for instant help with your Java code. |
The Java Keywords
This page shows the keywords that are used by the Java language. Keywords are words that are used by the Java comiler for specific operations so they're not allowed to be used for variables, methods etc. Below is a table that shows all the keywords and what they are used for: |
//Keyword //Description abstract //An abstract class or method assert //An assertion that a condition is fulfilled boolean //The Boolean type break //Breaks out of the current loop or labeled statement byte //The 8-bit signed integer type case //A label in a switch statement catch //The handler for an exception in a try block char //The 16-bit Unicode character type class //Defines a class const //Not used continue //Skip the remainder of a loop body default //The default label in a switch statement do //A loop whose body is executed at least once double //The 64-bit double-precision floating-point type else //The alternative clause in an if statement enum //An enumerated type extends //Indicates that a class is a subclass of another class final //A value that cannot be changed after it has been initialized, //a method that can't be overridden, or a class that can't be extended finally //A clause of a try block that is always executed float //The 32-bit single-precision floating-point type for //A loop with initialization, condition, and update expressions goto //Not used if //A conditional branch statement implements //Indicates that a class realizes an interface import //Allows the use of class names without the package name instanceof //Tests whether an object's type is a given type or a subtype thereof int //The 32-bit integer type interface //An abstract type with only abstract methods and constants long //The 64-bit integer type native //A method implemented in non-Java code new //Allocates an object package //A collection of related classes private //A feature that is accessible only by methods of the same class protected //A feature that is accessible only by methods of the same class, //a subclass, or another class in the same package public //A feature that is accessible by all methods return //Returns from a method short //The 16-bit integer type static //A feature that is defined for a class, not for individual instances strictfp //Use strict rules for floating-point computations super //Invoke the superclass constructor or a superclass method switch //A selection statement synchronized //A block of code that is accessible to only one thread at a time this //The implicit parameter of a method; //or invocation of another constructor of the same class throw //Throws an exception throws //The exceptions that a method may throw transient //Fields that should not be serialized try //A block of code with exception handlers or a finally handler void //Tags a method that doesn't return a value volatile //A field that may be accessed by multiple threads without synchronization while //A loop statement |
| Do you know your Java? | |
| Take a Ten-Question-Java-Quiz! | |
Search for code examples on this site
