Yesterday in class we played a game called “Key Words”. Everyone had to name the key word and explain as best they could what it meant. There were about 15 of us, enough for more than three laps. Some dropped out in the first, some in the second. On a happier note, I was the last to drop out. Those. took second place, if you can give out places, in this game. So, try your hand, without the help of Google, of course, otherwise the point is lost, remembering them all without explanation. To check yourself, look under the cat. Currently, there are 50 (fifty!) keywords defined in the JAVA language. There used to be a little more, but the current JAVA specification specifies 50 words, which are listed below. I tried to break them into groups, I won’t explain each one, so most of it should be clear. Primitives
- byte
- short
- int
- long
- char
- float
- double
- boolean
- if
- else
- switch
- case
- default
- while
- do
- break
- continue
- for
- try
- catch
- finally
- throw
- throws
- private
- protected
- public
- import
- package
- class
- interface
- extends
- implements
- static
- final
- void
- abstract
- native // signals that the method is implemented in platform-dependent code, often in C. For example, the hashcode method in Object has such a modifier.
- new
- return
- this
- super
- synchronized
- volatile
- const
- goto
- instanceof
- enum // enumeration
- assert // data check
- transient // applies to class fields and means that the field is not part of the persistent state of the class. Those. During serialization, this field will not be written. And, accordingly, during de-serialization it will not be restored from the byte stream.
- strictfp // I’ve heard everything except this word before, but I had to hear this for the first time (no one could name it and the word const, by the way). By modifying a class, method, interface with the strictfp keyword, you ensure that floating point calculations will be performed as in older versions. This is done to ensure that the results of floating point operations are consistent across all platforms.