Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / Knowledge base

Knowledge base

Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.

Entries: 5788

Java

Unsigned right shift operator (>>>)

The >>> operator shifts bits right and fills vacated positions on the left with zeros. Learn how it differs from >>, how operands are promoted, and how shift distances are masked.

Intermediate · Java SE 21; repository runtime, production runtime not attested
Java

Unsigned right shift assignment (>>>=)

The >>>= operator shifts bits right, fills vacated positions with zeros, and stores the result in the same variable. Unlike >>=, it does not sign-extend; promotion and conversion back matter for narrow types.

Intermediate · Java SE 21; repository runtime, production runtime not attested
Java

System.out.println: practical reference

System.out.println: practical reference: PrintStream.println writes the selected value using the matching overload, then writes the platform line separator; Object values are converted through String.valueOf.

Intermediate · Java SE 21 (JLS and Java SE API); examples verified on the repository Java runtime
Java

Java annotations: targets, retention, repetition, and reflection

In Java SE 21, an annotation declaration defines its data, where it may appear, and whether it is visible at run time. Learn how reflection reads that metadata, how repeated annotations are inherited, and how to scope unchecked-warning suppression.

Advanced · Java SE 21
Java

Annotation types — @interface

An @interface declaration defines an annotation type: metadata attached to code. Elements describe the annotation's data, while meta-annotations control allowed locations, retention, repeatability, and inheritance.

Intermediate · Java SE 21; repository runtime, production runtime not attested
Java

Anonymous classes in Java

An anonymous class lets you define an interface implementation or a subclass and create an instance of it in the same expression.

Intermediate · Java SE 21
Java

Array initializer

An array initializer creates an array from values enclosed in braces. The number of entries determines its length.

Basic · Java SE 21; repository runtime, production runtime not attested
Java

Java arrays: declaration, indexing, and length

Declare and create arrays, read and replace elements by index, and distinguish array length from list size. See what `new List[2]` creates and how to avoid raw `List` in new code.

Intermediate · Java SE 21
Java

Java class literals: `TypeName.class`

A `.class` literal gives you the object that represents a named type. Use it to filter values, specify an `EnumMap` key type, select a monitor, or configure a field updater.

Intermediate · Java SE 21
Java

Capturing effectively final local variables

A lambda can capture a local variable without the `final` modifier if it is effectively final. A fixed reference does not make the object it points to immutable.

Intermediate · Java SE 21
Java

Enum constant-specific class body

In Java SE 21, an `enum` constant can pass arguments to the enum constructor and have its own class body to define its behavior.

Intermediate · Java SE 21
Java

Generic type parameter bounds

Bounds restrict which types can be used as generic arguments. Learn how to preserve a builder’s concrete type, compare values through a supertype, and require several bounds at once.

Intermediate · Java SE 21
Java

Hexadecimal integer literal

A hexadecimal integer literal expresses a value in base 16 using the prefix 0x or 0X. The suffix L selects long; without a suffix, the literal has type int.

Basic · Java SE 21; repository runtime, production runtime not attested
Java

Java integer literals: the L suffix

Write `10000000001L` to make a `long` literal. Without the suffix, the value is too large for `int`, even if the destination variable is declared `long`.

Intermediate · Java SE 21
Java

Java’s `L` integer literal suffix

`0L` is zero of type `long`, while `0` is zero of type `int`. That difference matters for overload selection, arithmetic, and defaults that must be `Long`.

Advanced · Java SE 21
Java

Local class declaration in Java

A local class is a named nested class declared, for example, in a method block. The scope of its name does not limit the lifetime of its instances.

Intermediate · Java SE 21
Java

Method overloading

Method overloading lets several methods share a name while using different parameter lists. The compiler selects an overload using the arguments and their compile-time types, rather than the runtime classes of argument objects.

Basic · Java SE 21; repository runtime, production runtime not attested
Java

Multi-catch: shared exception handling

The catch (A | B e) syntax handles different exception types in one block. Alternative types must not have a subtype relationship, and the parameter e is implicitly final.

Intermediate · Java SE 21; repository runtime, production runtime not attested
Java

Nested classes and interfaces in Java

Distinguish static nested classes from inner classes, expose builder steps through public interfaces, and give a nested LRU cache its own type parameters.

Intermediate · Java SE 21
Java

Raw `List` and `ArrayList`

Raw `List` and `ArrayList` bypass compile-time element-type checks. Assigning a raw list to `List<String>` neither validates its contents nor recovers a type argument.

Intermediate · Java SE 21
Java

Compact canonical constructor for a record

In Java SE 21, a record’s compact canonical constructor validates or normalizes arguments before Java assigns their values to the component fields.

Advanced · Java SE 21