Loading…
Loading…
Topic
Articles and problems tagged OCP Java 21.
Ten exam-style questions on Java threads: platform versus virtual threads, Thread builders, start versus run, join, priorities, daemon threads, the six thread states and interrupting, with explanations.
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.