Java practice
Every Java exercise, built from a topic you can open beside it.
81 exercises runs offline
All tracks Python 139 JavaScript 184 TypeScript 76 Go 106 Rust 75 Java 81 Kotlin 66 C++ 92 C# 88 Swift 68 PHP 69 Frontend 82 Backend 139 Architecture and system design 25 DevOps and cloud 15 Data and databases 5 Data science 31 AI and LLM engineering 75 Security 26 Game development 26 Coding in the AI era 101 CS foundations 164
level
jvm Quiz new Which retention policy applies when an annotation interface has no `@Retention`? Attach structured metadata to Java declarations and type uses, then consume it correctly through compiler checks, processing, or reflection. jvm Quiz new What does `@Inherited` make a subclass query inherit? Attach structured metadata to Java declarations and type uses, then consume it correctly through compiler checks, processing, or reflection. jvm Predict the output new What does this program print? Attach structured metadata to Java declarations and type uses, then consume it correctly through compiler checks, processing, or reflection. jvm Review AI code new Review generated role dispatcher Attach structured metadata to Java declarations and type uses, then consume it correctly through compiler checks, processing, or reflection. jvm Spot the bug new Spot the bug in the scheduled job annotation Attach structured metadata to Java declarations and type uses, then consume it correctly through compiler checks, processing, or reflection. jvm Quiz new Why can a Java String containing one displayed symbol have length 2? The boundaries between Java primitives and references, conversion and boxing rules, and type mistakes that break production code. jvm Predict the output new What does this program print? The boundaries between Java primitives and references, conversion and boxing rules, and type mistakes that break production code. jvm Review AI code new Review generated invoice total The boundaries between Java primitives and references, conversion and boxing rules, and type mistakes that break production code. jvm Spot the bug new Spot the bug in the storage estimate The boundaries between Java primitives and references, conversion and boxing rules, and type mistakes that break production code. jvm Quiz new Which widening primitive conversion can lose numeric precision? The boundaries between Java primitives and references, conversion and boxing rules, and type mistakes that break production code. jvm Quiz new What must a method do when it calls code that may throw a checked exception? How Java exceptions propagate, where checked and unchecked failures belong, how resources close, and which failure-handling bugs generated code introduces. jvm Predict the output new What does this program print? How Java exceptions propagate, where checked and unchecked failures belong, how resources close, and which failure-handling bugs generated code introduces. jvm Review AI code new Review generated order importer How Java exceptions propagate, where checked and unchecked failures belong, how resources close, and which failure-handling bugs generated code introduces. jvm Spot the bug new Spot the bug in the blocking worker How Java exceptions propagate, where checked and unchecked failures belong, how resources close, and which failure-handling bugs generated code introduces. jvm Quiz new In try-with-resources, the body throws A and close() then throws B. What normally propaga… How Java exceptions propagate, where checked and unchecked failures belong, how resources close, and which failure-handling bugs generated code introduces. jvm Quiz new Which change makes a later read of a local variable definitely assigned? Understand program structure, variable scope, expression evaluation, and control flow in Java 25 without common short-circuit and boundary bugs. jvm Predict the output new What does this program print? Understand program structure, variable scope, expression evaluation, and control flow in Java 25 without common short-circuit and boundary bugs. jvm Review AI code new Review generated batch label planner Understand program structure, variable scope, expression evaluation, and control flow in Java 25 without common short-circuit and boundary bugs. jvm Spot the bug new Spot the bug in the total loop Understand program structure, variable scope, expression evaluation, and control flow in Java 25 without common short-circuit and boundary bugs. jvm Quiz new How does a block rule return a value from a Java switch expression? Understand program structure, variable scope, expression evaluation, and control flow in Java 25 without common short-circuit and boundary bugs. jvm Quiz new Which signature accepts an `Integer` source and a `Number` destination while preserving t… Java generics express type relationships across an API; understand bounds, wildcards, and erasure to design flexible, type-safe interfaces. jvm Quiz new Which operation is legal because the tested type is reifiable? Java generics express type relationships across an API; understand bounds, wildcards, and erasure to design flexible, type-safe interfaces. jvm Predict the output new What does this program print? Java generics express type relationships across an API; understand bounds, wildcards, and erasure to design flexible, type-safe interfaces. jvm Review AI code new Review generated reading merger Java generics express type relationships across an API; understand bounds, wildcards, and erasure to design flexible, type-safe interfaces. jvm Spot the bug new Spot the bug in the raw List Java generics express type relationships across an API; understand bounds, wildcards, and erasure to design flexible, type-safe interfaces. jvm Quiz new A local class captures List<String> events. Which operation is allowed while events remai… Distinguish nested and inner classes, understand enclosing instances, local capture, and anonymous classes, and avoid lifecycle and semantic bugs. jvm Quiz new Which statement uses the Java 25 specification terms correctly? Distinguish nested and inner classes, understand enclosing instances, local capture, and anonymous classes, and avoid lifecycle and semantic bugs. jvm Predict the output new What does this program print? Distinguish nested and inner classes, understand enclosing instances, local capture, and anonymous classes, and avoid lifecycle and semantic bugs. jvm Review AI code new Review generated job callback factory Distinguish nested and inner classes, understand enclosing instances, local capture, and anonymous classes, and avoid lifecycle and semantic bugs. jvm Spot the bug new Spot the bug in the inner-class factory Distinguish nested and inner classes, understand enclosing instances, local capture, and anonymous classes, and avoid lifecycle and semantic bugs. jvm Quiz new Which change definitely makes a valid functional interface stop being a functional interf… Java interfaces define replaceable behavior contracts; learn member rules, default-method conflicts, functional interfaces, and safe API evolution. jvm Quiz new What is true of `List<String> EVENTS = new ArrayList<>();` declared in an interface? Java interfaces define replaceable behavior contracts; learn member rules, default-method conflicts, functional interfaces, and safe API evolution. jvm Predict the output new What does this program print? Java interfaces define replaceable behavior contracts; learn member rules, default-method conflicts, functional interfaces, and safe API evolution. jvm Review AI code new Review generated token authorizer Java interfaces define replaceable behavior contracts; learn member rules, default-method conflicts, functional interfaces, and safe API evolution. jvm Spot the bug new Spot the bug in the default-method class Java interfaces define replaceable behavior contracts; learn member rules, default-method conflicts, functional interfaces, and safe API evolution. jvm Quiz new Which feature in this topic became final specifically in Java 17? The stable language features available at the Java 17 source level, with runnable examples and migration boundaries that prevent version drift. jvm Predict the output new What does this Java 17 program print? The stable language features available at the Java 17 source level, with runnable examples and migration boundaries that prevent version drift. jvm Predict the output new What does this program print about the record component? The stable language features available at the Java 17 source level, with runnable examples and migration boundaries that prevent version drift. jvm Review AI code new Review generated CSV row importer The stable language features available at the Java 17 source level, with runnable examples and migration boundaries that prevent version drift. jvm Spot the bug new Spot the bug in the Java 17 switch The stable language features available at the Java 17 source level, with runnable examples and migration boundaries that prevent version drift. jvm Predict the output new What does this stable Java 21 program print? Java 21's stable language and concurrency features, its preview boundary, and the version drift to catch when reviewing old examples on Java 25. jvm Quiz new What does `list.reversed()` return in the Java 21 sequenced-collection API? Java 21's stable language and concurrency features, its preview boundary, and the version drift to catch when reviewing old examples on Java 25. jvm Review AI code new Review generated Java 21 order loader Java 21's stable language and concurrency features, its preview boundary, and the version drift to catch when reviewing old examples on Java 25. jvm Spot the bug new Spot the bug in the virtual-thread task Java 21's stable language and concurrency features, its preview boundary, and the version drift to catch when reviewing old examples on Java 25. jvm Quiz new Which command proves that source uses only stable Java 21 language and Java SE APIs? Java 21's stable language and concurrency features, its preview boundary, and the version drift to catch when reviewing old examples on Java 25. jvm Quiz new A service starts one virtual thread per request, but its database accepts only 30 concurr… Java 21's stable language and concurrency features, its preview boundary, and the version drift to catch when reviewing old examples on Java 25. jvm Quiz new Which design best preserves an account invariant that the balance never becomes negative? Java objects organize state and behavior behind explicit boundaries; learn invariants, dynamic dispatch, substitutability, and composition. jvm Predict the output new What does this program print? Java objects organize state and behavior behind explicit boundaries; learn invariants, dynamic dispatch, substitutability, and composition. jvm Quiz new Which statement correctly distinguishes reference identity from value equality? Java objects organize state and behavior behind explicit boundaries; learn invariants, dynamic dispatch, substitutability, and composition. jvm Review AI code new Review generated member account Java objects organize state and behavior behind explicit boundaries; learn invariants, dynamic dispatch, substitutability, and composition. jvm Spot the bug new Spot the bug in the constructor hierarchy Java objects organize state and behavior behind explicit boundaries; learn invariants, dynamic dispatch, substitutability, and composition. jvm Quiz new What happens to a component parameter rebound inside a compact constructor? Model transparent data carriers with records, including derived members, compact constructors, shallow immutability, and record-pattern boundaries. jvm Predict the output new What does this program print? Model transparent data carriers with records, including derived members, compact constructors, shallow immutability, and record-pattern boundaries. jvm Quiz new Without `case null`, what happens when a pattern switch over records receives null? Model transparent data carriers with records, including derived members, compact constructors, shallow immutability, and record-pattern boundaries. jvm Review AI code new Review generated archive request key Model transparent data carriers with records, including derived members, compact constructors, shallow immutability, and record-pattern boundaries. jvm Spot the bug new Spot the bug in the HashMap record key Model transparent data carriers with records, including derived members, compact constructors, shallow immutability, and record-pattern boundaries. jvm Quiz new A class declares `void setLimit(int value)`. What happens when code calls `getMethod("set… Inspect runtime types and invoke members in Java 25 while handling exact lookup, module access, exception wrapping, and dynamic proxies correctly. jvm Quiz new Where is an exception thrown normally by a method invoked through `Method.invoke()`? Inspect runtime types and invoke members in Java 25 while handling exact lookup, module access, exception wrapping, and dynamic proxies correctly. jvm Predict the output new What does this program print? Inspect runtime types and invoke members in Java 25 while handling exact lookup, module access, exception wrapping, and dynamic proxies correctly. jvm Review AI code new Review a generated command dispatcher Inspect runtime types and invoke members in Java 25 while handling exact lookup, module access, exception wrapping, and dynamic proxies correctly. jvm Spot the bug new Spot the bug in reflective method lookup Inspect runtime types and invoke members in Java 25 while handling exact lookup, module access, exception wrapping, and dynamic proxies correctly. jvm Quiz new Which declarations can an ordinary class directly permitted by a sealed class use? Model closed type hierarchies with sealed, permits, and exhaustive pattern switches while handling extension, modules, and API evolution correctly. jvm Quiz new Where may a directly permitted subtype be declared? Model closed type hierarchies with sealed, permits, and exhaustive pattern switches while handling extension, modules, and API evolution correctly. jvm Predict the output new What does this program print? Model closed type hierarchies with sealed, permits, and exhaustive pattern switches while handling extension, modules, and API evolution correctly. jvm Review AI code new Review generated event audit hierarchy Model closed type hierarchies with sealed, permits, and exhaustive pattern switches while handling extension, modules, and API evolution correctly. jvm Spot the bug new Spot the bug in the sealed hierarchy Model closed type hierarchies with sealed, permits, and exhaustive pattern switches while handling extension, modules, and API evolution correctly. jvm Quiz new A persisted protocol key must use locale-neutral uppercase. Which expression states that … Java String value semantics, UTF-16 indexing, pooling, comparison, Unicode boundaries, encoding, and efficient construction. jvm Quiz new For String text = "A🚗", which statement is correct? Java String value semantics, UTF-16 indexing, pooling, comparison, Unicode boundaries, encoding, and efficient construction. jvm Predict the output new What does this program print? Java String value semantics, UTF-16 indexing, pooling, comparison, Unicode boundaries, encoding, and efficient construction. jvm Review AI code new Review generated CSV row formatter Java String value semantics, UTF-16 indexing, pooling, comparison, Unicode boundaries, encoding, and efficient construction. jvm Spot the bug new Spot the bug in the field parser Java String value semantics, UTF-16 indexing, pooling, comparison, Unicode boundaries, encoding, and efficient construction. jvm Quiz new A class implements `Decoder<Integer>` by declaring `Integer decode(String)`. Why may refl… Understand how Java generics become executable JVM types, and where type tokens, bridge methods, heap pollution, and runtime checks meet their limits. jvm Quiz new What is the erasure of `T` in `T extends CharSequence & Comparable<T>`? Understand how Java generics become executable JVM types, and where type tokens, bridge methods, heap pollution, and runtime checks meet their limits. jvm Predict the output new What does this program print? Understand how Java generics become executable JVM types, and where type tokens, bridge methods, heap pollution, and runtime checks meet their limits. jvm Review AI code new Review a generated decoder adapter Understand how Java generics become executable JVM types, and where type tokens, bridge methods, heap pollution, and runtime checks meet their limits. jvm Spot the bug new Spot the bug in the generic list helper Understand how Java generics become executable JVM types, and where type tokens, bridge methods, heap pollution, and runtime checks meet their limits. jvm Quiz new Why can a private `<T> void swap(List<T> values, ...)` helper accept a `List<?>` from a p… Java wildcards define safe read and write capabilities at generic API boundaries; use PECS, capture helpers, and named type parameters without unsafe casts. jvm Predict the output new What does this program print? Java wildcards define safe read and write capabilities at generic API boundaries; use PECS, capture helpers, and named type parameters without unsafe casts. jvm Review AI code new Review a generated wildcard transfer Java wildcards define safe read and write capabilities at generic API boundaries; use PECS, capture helpers, and named type parameters without unsafe casts. jvm Spot the bug new Spot the bug in the wildcard copy method Java wildcards define safe read and write capabilities at generic API boundaries; use PECS, capture helpers, and named type parameters without unsafe casts. jvm Quiz new Given `List<? extends Number> values`, which operation is guaranteed to type-check? Java wildcards define safe read and write capabilities at generic API boundaries; use PECS, capture helpers, and named type parameters without unsafe casts.
No practice items match these filters.