Loading…
Loading…
Short multiple-choice checks on what you have read. Sign in to take them and keep your best score.
A 20-question mixed review of OCP Java 21 Chapter 12: module benefits and declarations, compiling and running modules, exports, requires transitive and opens, services with ServiceLoader, the module commands, and named, automatic and unnamed modules with migration strategies.
Ten exam-style questions on named, automatic and unnamed modules, automatic module naming from the manifest and file name, what each module type exports and reads, bottom-up and top-down migration, split packages and cyclic dependencies, with explanations.
Ten exam-style questions on the module tools: java --describe-module, --list-modules and --show-module-resolution, jar --describe-module, jdeps options, jmod modes, jlink runtime images, jpackage and the built-in java and jdk modules, with explanations.
Ten exam-style questions on module services: the service provider interface, service locator, consumer and provider, the uses and provides directives, ServiceLoader with findFirst, stream and Provider, and the rules for provider classes, with explanations.
Ten exam-style questions on module-info.java directives: exports and qualified exports, what an exported package exposes, requires, requires transitive and implied readability, requires static, duplicate and cyclic requires, opens and open modules, with explanations.
Ten exam-style questions on module benefits, module-info.java rules and module names, the javac -p and -d options, running with java -p and -m, packaging module JARs, and linking modules with exports and requires, with explanations.
A 20-question mixed review of OCP Java 21 Chapter 11: checked and unchecked exceptions, overriding rules, common exception classes, catch ordering, multi-catch, finally, try-with-resources and suppressed exceptions, formatting, locales, resource bundles and MessageFormat.
Ten exam-style questions on resource bundle naming, the bundle search order, key inheritance along the chosen hierarchy, MissingResourceException, MessageFormat placeholders and quoting, and the Properties class, with explanations.
Ten exam-style questions on Locale formats and creation, NumberFormat factories, locale-aware parsing, CompactNumberFormat SHORT and LONG, localized date styles with withLocale, and Locale.Category, with explanations.
Ten exam-style questions on DecimalFormat patterns, rounding and parsing, ISO DateTimeFormatter constants, custom date/time pattern letters, type compatibility, escaping literal text, and parsing dates, with explanations.
Ten exam-style questions on try-with-resources: AutoCloseable and Closeable, resource declaration syntax, effectively final resources, scope, closing order relative to catch and finally, suppressed exceptions and failing resources, with explanations.
Ten exam-style questions on try and catch syntax, ordering chained catch blocks, multi-catch rules, finally execution order, return values with finally, exceptions thrown from finally, System.exit and precise rethrow, with explanations.
Ten exam-style questions on recognizing common Java exceptions: ArithmeticException, index and cast exceptions, NullPointerException, IllegalArgumentException and NumberFormatException, checked IOException and ParseException, and errors from static initializers and recursion, with explanations.
Ten exam-style questions on the Throwable hierarchy, checked versus unchecked exceptions, handle or declare, throw versus throws, unreachable code and catch blocks, exception rules for overriding and constructors, custom exceptions and printing exceptions, with explanations.
A 20-question mixed review of OCP Java 21 Chapter 10: Optional, stream pipelines and laziness, terminal and intermediate operations, primitive streams and their optionals, summary statistics, and collectors including toMap, groupingBy, partitioningBy and teeing.
Ten exam-style questions on Collectors: joining, counting and averaging return types, toMap duplicate keys and merge functions, groupingBy with downstream collectors and map factories, partitioningBy, mapping, teeing, Spliterator and late binding of stream sources, with explanations.
Ten exam-style questions on IntStream, LongStream and DoubleStream, range versus rangeClosed, sum and average return types, primitive optionals, mapping methods and their functional interfaces, boxed, and summaryStatistics on empty streams, with explanations.
Ten exam-style questions on filter, distinct, limit and skip, map and flatMap, concat, sorted and the Comparator::reverseOrder trap, peek, takeWhile and dropWhile, operation order on infinite streams, and checked exceptions in lambdas, with explanations.
Ten exam-style questions on count, min and max, findFirst and findAny, the match methods and empty streams, forEach, the three reduce signatures, collect with supplier, accumulator and combiner, toList and toArray, with explanations.
Ten exam-style questions on stream pipeline parts, lazy evaluation, single use, finite sources such as Stream.of, ofNullable and Arrays.stream, infinite sources generate and iterate, and which terminal operations finish on infinite streams, with explanations.
Ten exam-style questions on creating Optional with of, ofNullable and empty, unwrapping with get, orElse, orElseGet and orElseThrow, ifPresent, and chaining map, filter, flatMap, or and stream, with explanations.
A 20-question mixed review of OCP Java 21 Chapter 9: common Collection methods, List, Set, Queue and Deque, Map and its merge and compute methods, sorting with Comparable and Comparator, sequenced collections, generic classes and methods, and wildcards.
Ten exam-style questions on generic invariance, unbounded, upper-bounded and lower-bounded wildcards, what you can add and read through each, PECS, List<?> versus var, and illegal wildcard declarations, with explanations.
Ten exam-style questions on declaring generic classes, interfaces and records, generic method syntax, type erasure and its limits, overloading and overriding with generic types, shadowed type parameters and bounded type parameters, with explanations.
Ten exam-style questions on Java 21 SequencedCollection, SequencedSet and SequencedMap methods, which classes are sequenced, sequenced versus sorted, reversed views, unmodifiable views versus copies, and choosing a collection type, with explanations.
Ten exam-style questions on compareTo and compare, the return value contract, Comparator helper methods and chaining with reversed, Collections.sort versus TreeSet checks, and binarySearch results, with explanations.
Ten exam-style questions on HashMap, LinkedHashMap and TreeMap, Map.of and Map.ofEntries, put and getOrDefault return values, putIfAbsent and replace, forEach and entrySet, and the null rules of merge and the compute methods, with explanations.
Ten exam-style questions on HashSet, LinkedHashSet and TreeSet ordering and rules, Set.of and Set.copyOf, Queue methods that throw or return null, Deque methods at both ends, stack operations, and ArrayDeque versus LinkedList, with explanations.
Ten exam-style questions on ArrayList and LinkedList, Arrays.asList, List.of and List.copyOf, index-based list methods, the overloaded remove, indexOf, replaceAll and toArray, with explanations.
Ten exam-style questions on the Collections Framework interfaces, generics with diamond and var, and the Collection methods add, remove, contains, removeIf, forEach, iterators, equals, null unboxing and unmodifiable collections, with explanations.