Content deleted Content added
CortexFiend (talk | contribs) Link suggestions feature: 2 links added. |
|||
(3 intermediate revisions by 2 users not shown) | |||
Line 16:
:
;<code>[[boolean data type|boolean]]</code>
:Defines a boolean variable for the values "true" or "false" only. By default, the value of boolean primitive type is false. This keyword is also used to declare that a method returns a value of the primitive type <code>[[boolean data type|boolean]]</code>. In most other languages, the Boolean type is usually simply called <code>bool</code>.
;<code>[[break statement|break]]</code>
Line 23:
;<code>[[byte]]</code>
:The <code>byte</code> keyword is used to declare a field that can hold an 8-bit signed [[two's complement]] integer.<ref name="primitive"/>{{sfn|Flanagan|2005|p=22}} This keyword is also used to declare that a method returns a value of the primitive type <code>byte</code>.<ref name="return"/>{{sfn|Flanagan|2005|pp=66-67}}
;<code>[[switch statement|case]]</code>{{Anchor|case}}
Line 80:
;<code>import</code>{{Anchor|import}}
:Used at the beginning of a [[source file]] to specify classes or entire [[Java package]]s to be referred to later without including their package names in the reference. Since J2SE 5.0, <code>import</code> statements can import <code>static</code> members of a class. A [[Java Platform Module System|Java module]] may itself be imported (by writing <code>import module</code>), automatically importing all exported packages.<ref>{{Cite web|url=https://openjdk.org/jeps/494|title=JEP 494: Module Import Declarations (Second Preview)|website=openjdk.org}}</ref>
;<code>instanceof</code>
Line 152:
;<code>[[volatile variable|volatile]]</code>
:Used in field declarations to guarantee visibility of changes to variables across threads. Every read of a volatile variable will be read from main memory, and not from the [[CPU cache]], and that every write to a volatile variable will be written to main memory, and not just to the CPU cache.<ref name="Java Volatile Keyword">{{cite web | title=Java Volatile Keyword | url=http://tutorials.jenkov.com/java-concurrency/volatile.html}}</ref> Methods, classes and interfaces thus cannot be declared ''volatile'', nor can local variables or parameters.
;<code>[[do while loop|while]]</code>{{Anchor|while}}
|