Java キーワードは、識別子として使用されないプログラミング言語の予約語です。 Java キーワードは、使用している言語によって「予約」されているため、予約語と呼ばれます。これらには、言語のライブラリで定義されている特別な意味があります。
無料ソフトウェア開発コースを始めましょう
Web 開発、プログラミング言語、ソフトウェア テスト、その他
Java プログラミング言語の概念
他のプログラミング言語と同様、Java プログラミング言語のキーワードは特別な意味を持つ予約語です。キーワードは内部プロセス用に予約されており、いくつかの事前定義されたアクションがあります。 Java では、キーワードがそれ以外の方法で使用されると、プログラムまたはコードで「コンパイル時エラー」が発生します。プログラマが使いやすく、キーワードを識別しやすいように、Java ではキーワードが少し「強調表示」されます。
Java のキーワードのリスト
現在 Java で使用されている重要なキーワードを以下にアルファベット順にリストしてみました。同じ例に従うことで、すべてのキーワードの動作を観察することもできます。これらのキーワードを一つずつ見ていきましょう。
1. Abstract: Abstract The keyword is used to declare a class to be used later in the abstract program. Abstract used with a class declaration makes that class an abstract and specifies that the class will be implemented in a subclass at a later stage. Below is an example of the usage of the ‘Abstract’ keyword.2. Assert: The ‘assert’ keyword was added to Java 1.4. This keyword allows a programmer to test his assumptions in the program.
3. Boolean: Boolean is a data type that can hold only two values; it’s either a ‘True’ or a ‘False’.
4. Break: This keyword helps the programmer want his code to jump out of a loop, for example, a For loop. It’s a control statement that breaks the current flow of the execution on a specific condition provided by the programmer.
5. Byte: Byte keyword is one of the data types that are able to store whole numbers. The numbers range from -128 to 127
6. Case: Case keyword is used in a switch statement. The ‘case’ keyword creates a block of code and marks it.
7. Catch: The ‘catch’ keyword catches the exceptions that were created by the ‘try’ statements. The catch block is used after Try block.
8. Char: The ‘char’ is one of the data types that is used to hold one character at a time.
9. Class: The class keyword is used to create a class in java. Everything that runs in Java programming resides inside a class.
10. Continue: The ‘continue’ keyword is used to skip the current execution and continues to the next step in a loop like a For loop or a While loop.
11. Default: The ‘Default’ keyword is used to create a default block of code containing a set of statements executed by default if the required case is not present.
12. Do: The ‘do’ keyword is used when creating a ‘do-while’ loop. The ‘do’ block is executed at least once before checking the condition in a while block.
13. Double: The ‘double’ keyword is one of the data types used for holding fractional numbers. The fractional numbers range from 1.7e – 308 to 1.7e + 308. While declaring a fraction, the value is ended with a ‘d’.
14. Else: The ‘Else’ keyword is used to create a block of code that will be executed if the condition is not ‘True’ in an ‘If’ statement.
15. Enum: The ‘enum’ keyword is used to create enumerations, unchangeable data types. The enum keyword defines a fixed set of constants.
16. Extends: Extends keyword is used to inherit properties of a superclass’s attributes and methods by a subclass.
17. Final: The ‘Final’ keyword is used to set a final value to a variable, making it impossible to overwrite or change altogether. If the value of a final variable is tried to change, it throws an error.
When hovered over, it shows the following error.
18. Finally: Finally keyword is used along try and catch statements, which has a block that is executed even if the exception is not handled.
19. Float: float キーワードは、3.4e-038 から 3.4e+038 までの範囲の小数を保持するデータ型です。小数を宣言する場合、値は「f」で終わる必要があります。
20。 For: 「For」キーワードは、ループ (for ループ) を作成するために使用されます。 for ループは、for ループ条件ステートメント内で定義されている、囲まれたコードのセットを何度も実行します。
21。 If: 「If」キーワードは、条件が「True」の場合に実行されるコードまたはステートメントのセットまたはブロックを作成するために使用されます。
22. Implements: Implement は、インターフェイスを宣言するために予約されているもう 1 つのキーワードです。これはクラスの宣言中に使用され、1 つ以上のインターフェイスを指定します。
23. Import: import キーワードは、パッケージ、クラス、またはインターフェイスをインポートするために使用されます。
24. Instanceof: 「instanceof」キーワードは、問題のオブジェクトがクラスまたはインターフェイスのインスタンスであるかどうかを確認するために使用されます。
25. Int: 「int」キーワードは、整数型を宣言するためのデータ型の 1 つです。
26. Interface: Interface キーワードは、抽象メソッドのみを含む特別なタイプのクラスを宣言するために使用されます。インターフェイス メソッドにアクセスするには、「implements」キーワードを使用して別のクラスによる継承の概念を使用するのと同じように、インターフェイスを「実装」する必要があります。
27. Long: 「long」キーワードも、整数を保持するためのデータ型の 1 つです。範囲は -9223372036854775808 から 9223372036854775808 です。整数値は「L」で終わる必要があります。
28. New: 「new」キーワードはオブジェクトの作成に使用されます。
29. Package: 「package」キーワードはパッケージの作成に使用されます。30. Private: 「private」キーワードは、プライベート モード クラスの属性またはメソッドを作成するために使用されます。 「Private」は、宣言されたクラスのみがプライベート プロパティ、属性、メソッドを使用できるようにするアクセス修飾子です。
31. Protected: 「Protected」は、同じパッケージまたはサブクラスでのみプロパティまたはメソッドを使用できるようにするアクセス修飾子です。
32. Public: 「public」キーワードは、あるクラスがそれ自体内でパブリックに定義されたクラスの属性やメソッドなどを使用できるようにする別のアクセス修飾子です。
以下は、公的に定義されたクラス「test.java」と別のクラス、クラス「Test2.java」です。これにアクセスします。クラス – Test2.java
33. Return: 「return」キーワードはメソッドの実行終了として使用でき、メソッドから値を返すためにも使用されます。
34. Short: 「short」キーワードは、-32768 から 32767 までの整数を保持するために使用されるデータ型の一種です。
35。 Static: 「static」キーワードは static メソッドを作成するために使用されます。これは、オブジェクトを作成せずにメソッドを呼び出すことができることを意味します。
36. Super: 「super」キーワードは、スーパーまたは親クラスまたはオブジェクトを呼び出すために使用されます。
37. Switch: 「switch」キーワードは、さまざまなケースにさまざまなシナリオを作成するために使用され、その中から 1 つを選択するために使用されます。 switch ステートメントには値または式が含まれており、存在するすべてのケースと比較され、一致するものが選択されます。
38. This: 「this」キーワードは、メソッドまたはコンストラクターの現在のオブジェクトを参照するために使用されます。
39. Throw: 「throw」キーワードは、ユーザーの画面に例外メッセージをスローするために使用されます。
40. Throws: 「throws」キーワードは、プログラマが例外.41 のタイプ、具体的には を決定してスローしたい場合に使用されます。 Try: 「try」キーワードは「try-catch」ブロックを開始します。 「try」ブロックは例外がテストされる場所です。
42. Void: 「void」キーワードは、メソッドで使用される場合、メソッドが戻り値を持たないことを指定します。
43. While: 「while」キーワードは、ステートメントに条件を含むループを作成します。ステートメントが true になるまでループが実行されます。
キーワードは、予約されており特別な意味を持つ Java プログラミング言語のトークンです。これらには、その言語で予約された使用と事前定義されたアクションがあります。
以上がJava キーワードの詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

ホットAIツール

Undresser.AI Undress
リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

AI Hentai Generator
AIヘンタイを無料で生成します。

人気の記事

ホットツール

MinGW - Minimalist GNU for Windows
このプロジェクトは osdn.net/projects/mingw に移行中です。引き続きそこでフォローしていただけます。 MinGW: GNU Compiler Collection (GCC) のネイティブ Windows ポートであり、ネイティブ Windows アプリケーションを構築するための自由に配布可能なインポート ライブラリとヘッダー ファイルであり、C99 機能をサポートする MSVC ランタイムの拡張機能が含まれています。すべての MinGW ソフトウェアは 64 ビット Windows プラットフォームで実行できます。

ドリームウィーバー CS6
ビジュアル Web 開発ツール

WebStorm Mac版
便利なJavaScript開発ツール

ZendStudio 13.5.1 Mac
強力な PHP 統合開発環境

メモ帳++7.3.1
使いやすく無料のコードエディター
