Free · no sign-up · no time limit
Ready-made multiple-choice practice quizzes, hand-checked. Take any free quiz online — every answer comes with an explanation, and every quiz page has a full answer key to revise from.
Free · no sign-up · no time limit
Ready-made multiple-choice practice quizzes, hand-checked. Take any free quiz online — every answer comes with an explanation, and every quiz page has a full answer key to revise from.
IT
Test your mastery of modern Java features including Virtual Threads, Sealed Classes, Pattern Matching, and JVM internals. Answer each question to see whether you got it right, with an explanation every time.
A free 16-question multiple-choice practice test on IT. Each question has one correct answer and a short explanation, and the full answer key below the player doubles as a study sheet. No account, no time limit — take it as often as you like.
This is a free, 16-question multiple-choice quiz. Answer each question to see whether you got it right, with an explanation for every answer. There is no sign-up and no time limit — take it as many times as you like, and use the answer key above to revise before or after.
Correct answer: BThe virtual thread unmounts from its carrier thread, freeing it for other tasks
Project Loom virtual threads unmount from their carrier platform thread upon encountering standard blocking calls, allowing the carrier to execute other runnable virtual threads.
Correct answer: BExecuting blocking file I/O inside a synchronized block or method
When a virtual thread executes inside a synchronized block/method or native call (JNI), it is pinned to its carrier thread and cannot unmount during blocking operations.
Correct answer: AThey must be declared as final, sealed, or non-sealed
Every permitted subclass of a sealed class must explicitly declare a modifier to define its inheritance boundary: final, sealed, or non-sealed.
Correct answer: BRecord patterns
Record patterns allow matching a record type and simultaneously extracting its component variables directly within switch cases and instanceof checks.
Correct answer: BIt offers pure Java bindings to off-heap memory and foreign functions without C glue code
The FFM API allows Java programs to allocate off-heap memory safely via Arena and link foreign native functions without authoring boilerplate C/C++ JNI wrappers.
Correct answer: BIt treats concurrent tasks running in subthreads as a single unit of work with clean cancellation
Structured Concurrency links related concurrent subtasks into a lexical scope, ensuring error propagation, short-circuit cancellation, and reliable cleanup.
Correct answer: CZGC
ZGC performs almost all garbage collection work concurrently, keeping pause times typically under one millisecond regardless of whether the heap is gigabytes or terabytes in size.
Correct answer: AIt must match the accessibility level of the record class itself
A compact constructor in a record implicitly has the same access modifier as the record class itself.
Correct answer: BArena
An Arena controls the lifecycle of native memory segments, providing deterministic, bounded allocation scopes like automatic, global, or confined arenas.
Correct answer: BThe compiler raises a compilation error due to inexhaustive patterns
Pattern matching in switch expressions requires exhaustiveness; omitting a permitted subclass of a sealed hierarchy without a default branch results in a compile-time error.
Correct answer: BScoped values are immutable, bound to a call scope, and shareable efficiently across thousands of threads
Scoped values provide lightweight, immutable data inheritance suited for millions of virtual threads, avoiding the unbound memory overhead of ThreadLocal.
Correct answer: BThe subclass re-opens the inheritance hierarchy so any other class can extend it
The 'non-sealed' modifier breaks the closed hierarchy, allowing unknown subclasses to extend it freely while preserving the sealed rules of its parent.
Correct answer: BTo express vector computations that compile into SIMD instructions on supported hardware
The Vector API allows developers to express data-parallel computations directly in Java, generating optimal Single Instruction Multiple Data (SIMD) CPU instructions at runtime.
Correct answer: BThey combine literal text with embedded expressions processed safely by template processors
String Templates combine text with expressions via processors (like STR or RAW) to safely produce domain objects, JSON, or validated SQL.
Correct answer: BIt reduces the standard object header size from 128/96 bits down to 64 bits
Project Lilliput optimizes object headers by shrinking the mark and class-pointer words into a single 64-bit word, significantly reducing heap footprints.
Correct answer: AIt is scoped only to the lines where the condition evaluates to true
Flow typing governs pattern variables; they are only in scope where the matching condition is definitely true (flow scoping).