Content deleted Content added
CortexFiend (talk | contribs) Link suggestions feature: 2 links added. |
|||
(7 intermediate revisions by 3 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 32:
;<code>[[character (computing)|char]]</code>
:Defines a character variable capable of holding any character of the
;<code>[[class (computer science)#Java|class]]</code>
:A type that defines the implementation of a particular kind of object. A class definition defines [[Object (computer science)|instance]] and class [[field (computer science)|fields]], [[method (computer science)|methods]], and [[inner class]]es as well as specifying the [[interface (computer science)|interfaces]] the class implements and the immediate [[superclass (computer science)|superclass]] of the class. If the superclass is not explicitly specified, the superclass is implicitly {{Javadoc:SE|java/lang|Object}}. The class keyword can also be used in the form <code>Class
;<code>[[continue (Java)|continue]]</code>
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 122:
;<code>[[inheritance (object-oriented programming)|super]]</code>
:Inheritance basically used to achieve dynamic binding or run-time polymorphism in
:Also used to specify a lower bound on a type parameter in Generics.
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}}
Line 163:
:Used in a module declaration to specify which packages are available to other modules.
;<code>[[
:Declares a [[Modular programming|module]] (a collection of related packages and resources that can be treated as a unit), used to encapsulate and expose only the public API of a library.
;<code>non-sealed</code>
Line 199:
:Used in a module to declare that the module is using a service (i.e. it will consume a service provided by other modules).
;<code>[[Type inference|var]]</code>
:A special identifier that cannot be used as a type name (since Java 10).<ref>{{cite web |url=https://docs.oracle.com/javase/specs/jls/se11/html/jls-3.html#jls-3.9|title=Chapter 3. Lexical Structure|website=docs.oracle.com|access-date=2018-12-25}}</ref> Used to declare a variable without explicitly specifying the type, rather relying on the compiler to infer the type based on the initialiser.
;<code>when</code>
|