default — fallback branch or implementation
default — fallback branch or implementation: default marks an unmatched switch branch, an interface method with an implementation, or an annotation element’s default value.
CKTIS / Java
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
default — fallback branch or implementation: default marks an unmatched switch branch, an interface method with an implementation, or an annotation element’s default value.
do — post-test loop: A do statement executes its body before testing the boolean expression after while, so the body runs at least once.
else — alternative if branch: else supplies the alternative statement for the nearest preceding if whose boolean condition evaluated to false.
enum — enumeration type declaration: enum declares an enum class with a finite set of instances; each constant may take arguments and have a constant-specific class body that overrides behavior.
exports — module package export: An exports directive in module-info.java gives other modules access to a package’s public top-level types. Public or protected members and nested types remain subject to the ordinary access-control rules.
extends — inheritance and upper bounds: extends names a class’s direct superclass, an interface’s direct superinterfaces, or the upper bound of a type parameter or wildcard.
final — restriction on further change: final restricts change: a variable can be assigned once, a method cannot be overridden, and a class cannot be subclassed.
finally — cleanup after try: A finally clause belongs to try and runs after the try block and any selected catch when control completes them normally or by most abrupt-completion reasons.
for — basic and enhanced loops: The for statement is either basic with initialization, condition, and update, or enhanced for, which successively assigns elements from an array or Iterable.
goto — reserved unused keyword: goto is a reserved but unused Java keyword: the parser accepts it neither as an identifier nor as a jump statement.
if — conditional selection: An if statement selects a branch from a boolean expression; an optional else belongs to the nearest unmatched if unless braces change the structure.
implements — implementing interfaces: An implements clause on a class or record declaration lists direct superinterfaces; a concrete class must provide inherited abstract methods.
import — names from other packages: An import declaration in a compilation unit makes a type or static member available by simple name; it neither loads a class at runtime nor creates an alias.
interface — type contracts: An interface declaration defines a reference type with member contracts; fields are public static final, while methods may be abstract, default, static, or private.
module — JPMS module declaration: module is a contextual keyword that begins a module declaration in module-info.java; outside that context it may be an ordinary identifier.
native — method outside Java: The native modifier declares a method implemented outside the Java language; the declaration ends with a semicolon and has no Java body.
new — creating objects and arrays: The new operator creates a class instance through a class instance creation expression or creates an array; for a class it allocates the object and then runs the selected constructor.
The keyword non-sealed: The non-sealed modifier reopens a class or interface that is a direct permitted subtype of a sealed type.
The keyword open: The open modifier on a module declaration opens every package for deep run-time reflection without exporting those packages.
The keyword opens: The opens directive opens one module package for deep run-time reflection, optionally only to modules named after to.
The keyword package: A package declaration assigns at most one package name to an ordinary compilation unit and namespaces its top-level types.
The keyword permits: A permits clause lists the direct classes or interfaces allowed to extend the declared sealed type.
The keyword private: The private modifier restricts a member to the body of its declaring top-level class and that class’s nestmates.
The keyword protected: The protected modifier exposes a member within its package and to subclass code under special inherited-access rules.