Home >Java >Javagetting Started >What are java keywords
Java keywords are pre-defined identifiers with special meanings in the computer language, sometimes called reserved words, and variables with special meanings. Java keywords have special meaning to the Java compiler. They are used to represent a data type, or the structure of a program, etc. Keywords cannot be used as variable names, method names, class names, package names, and parameters.
Java keywords are strings that have special meaning to the Java compiler. They are compilers and programs. An agreement among programmers, programmers use keywords to tell the compiler information such as variable types, classes, method characteristics and other information they declare. The Java language defines a total of keywords as shown below. (Recommended study: java course)
Keywords are always identified with lowercase letters, press The uses are divided into the following groups.
(1) is used for data types.
The keywords used for data types are boolean, byte, char, double, false, float, int, long, new, short, true, void, instanceof.
(2) is used for statements.
The keywords used for statements include break, case, catch, continue, default, do, else, for, if, return, switch, try, while, finally, throw, this, super.
(3) Used to modify
The keywords used for modification include abstract, final, native, private, protected, public, static, synchronized, transient, volatile .
(4) is used for methods, classes, interfaces, packages and exceptions.
The keywords used for methods, classes, interfaces, packages, and exceptions are class, extends, implements, interface, package, import, and throws.
There are also some keywords, such as cat, future, generic, innerr, operator, outer, rest, var, etc., which are meaningless keywords reserved by Java.
In addition, Java has three reserved words: true, false, and null. They are not keywords, but text. Contains Java-defined values. Like keywords, they cannot be used as identifiers.
The above is the detailed content of What are java keywords. For more information, please follow other related articles on the PHP Chinese website!