# Java 关键字

> 原文： [https://howtodoinjava.com/java-keywords/](https://howtodoinjava.com/java-keywords/)

Java 关键字是 50 个保留字，在应用程序代码中具有非常特定的含义。 程序员不应将这些关键字用于其预期的其他目的。

## 1\. Java 关键字特性

*   给定的是列表具有所有保留的 java 关键字。 我们不能在程序中使用以下任何内容作为标识符。
*   关键字`const`和`goto`被保留，即使它们当前未被使用。
*   `true`，`false`和`null`看起来像关键字，但它们实际上是字面值。 我们不能在程序中使用它们作为标识符。
*   `strictfp`已在 JDK 1.2 中添加。
*   `assert`已在 JDK 1.4 中添加。
*   `enum`已在 JDK 1.5 中添加。

## 2\. Java 关键字列表

| | | | | |
| --- | --- | --- | --- | --- |
| [`abstract`](https://howtodoinjava.com/java/basics/abstract-keyword/) | [`continue`](https://howtodoinjava.com/java/basics/continue-keyword-statement-in-java/) | [`for`](https://howtodoinjava.com/java/basics/for-loop-in-java/) | `new` | [`switch`](https://howtodoinjava.com/java/basics/switch-statement-in-java/) |
| [`assert`](https://howtodoinjava.com/java/basics/java-assert/) | [`default`](https://howtodoinjava.com/java8/default-methods-in-java-8/) | `goto` | `package` | [`synchronized`](https://howtodoinjava.com/java/multi-threading/java-synchronized/) |
| [`boolean`](https://howtodoinjava.com/java/basics/java-boolean/) | [`do`](https://howtodoinjava.com/java/basics/do-while-loop-in-java/) | [`if`](https://howtodoinjava.com/java/basics/if-else-statement-in-java/) | [`private`](https://howtodoinjava.com/oops/java-access-modifiers/) | [`this`](https://howtodoinjava.com/java/basics/this-vs-super/) |
| [`break`](https://howtodoinjava.com/java/basics/break-keyword-statement-in-java/) | `double` | [`implements`](https://howtodoinjava.com/oops/extends-vs-implements/) | [`protected`](https://howtodoinjava.com/oops/java-access-modifiers/) | [`throw`](https://howtodoinjava.com/java/exception-handling/throw-vs-throws/) |
| `byte` | [`else`](https://howtodoinjava.com/java/basics/if-else-statement-in-java/) | `import` | [`public`](https://howtodoinjava.com/oops/java-access-modifiers/) | [`throws`](https://howtodoinjava.com/java/exception-handling/throw-vs-throws/) |
| [`case`](https://howtodoinjava.com/java/basics/switch-statement-in-java/) | [`enum`](https://howtodoinjava.com/java/enum/guide-for-understanding-enum-in-java/) | [`instanceof`](https://howtodoinjava.com/oops/java-instanceof/) | `return` | [`transient`](https://howtodoinjava.com/java/basics/transient-keyword-in-java-with-real-time-example/) |
| [`catch`](https://howtodoinjava.com/java/exception-handling/try-catch-finally/) | [`extends`](https://howtodoinjava.com/oops/extends-vs-implements/) | `int` | `short` | [`try`](https://howtodoinjava.com/java/exception-handling/try-catch-finally/) |
| `char` | [`final`](https://howtodoinjava.com/java/basics/final-finally-finalize/) | `interface` | [`static`](https://howtodoinjava.com/java/basics/java-static-keyword/) | `void` |
| `class` | [`finally`](https://howtodoinjava.com/java/exception-handling/try-catch-finally/) | `long` | [`strictfp`](https://howtodoinjava.com/java/basics/strictfp-modifier/) | `volatile` |
| `const` | `float` | `native` | [`super`](https://howtodoinjava.com/java/basics/this-vs-super/) | [`while`](https://howtodoinjava.com/java/basics/while-loop-in-java/) |

无法在单个页面中了解所有关键字。 我们将在专用教程中了解每个 Java 关键字。

学习愉快！