Loading…
Loading…
Java
Exam-prep course for the Oracle Certified Professional Java SE 21 Developer exam (1Z0-830), with notes on the Java 25 successor exam (1Z0-831). Every article ships with a verified practice quiz.
Stream terminal operations for the OCP 21 exam: count, min and max with a Comparator, findFirst and findAny, anyMatch, allMatch and noneMatch, forEach, the three reduce signatures, collect with a supplier, accumulator and combiner, toList and toArray, and which ones finish on infinite streams.
kvi5hnuCode Sprout team member8 minStream pipelines for the OCP 21 exam: source, intermediate and terminal operations, lazy evaluation and single use, creating streams with Stream.of, ofNullable, collection.stream, Arrays.stream, generate and both forms of iterate, plus parallel streams and the late-binding source.
kvi5hnuCode Sprout team member7 minOptional for the OCP 21 exam: creating with of, ofNullable and empty, checking with isPresent and isEmpty, unwrapping with get, orElse, orElseGet and orElseThrow, ifPresent and ifPresentOrElse, and chaining map, filter, flatMap, or and stream.
kvi5hnuCode Sprout team member6 minGeneric wildcards for the OCP 21 exam: why List<String> isn't a List<Object>, unbounded ?, upper-bounded ? extends and lower-bounded ? super, what you can read and add through each, PECS, List<?> versus var, and the tricky declarations the exam uses.
kvi5hnuCode Sprout team member7 minGenerics for the OCP 21 exam: declaring generic classes, interfaces and records, type parameter naming, type erasure and its limits, overloading and overriding with generic types, generic methods and explicit type arguments, shadowed type parameters, and bounded type parameters.
kvi5hnuCode Sprout team member9 minJava 21 sequenced collections for the OCP exam: getFirst, addLast, removeFirst and reversed on SequencedCollection, SequencedSet and SequencedMap methods, sequenced versus sorted, which classes qualify, unmodifiable views, and a review table of every collection type.
kvi5hnuCode Sprout team member8 minSorting for the OCP 21 exam: writing compareTo with Comparable, building Comparator objects with lambdas, comparing, thenComparing and reversed, Collections.sort versus List.sort, binarySearch return values, and why TreeSet fails at run time without an order.
kvi5hnuCode Sprout team member9 minMaps for the OCP 21 exam: HashMap, LinkedHashMap and TreeMap ordering, Map.of, ofEntries and copyOf, get, getOrDefault, put, putIfAbsent, replace, replaceAll, forEach and entrySet, plus the exact null rules of merge, compute, computeIfAbsent and computeIfPresent.
kvi5hnuCode Sprout team member9 minSets, queues and deques for the OCP 21 exam: HashSet, LinkedHashSet and TreeSet ordering, Set.of and Set.copyOf, null and Comparable rules, Queue methods that throw versus return null, Deque methods at both ends, stacks with push, pop and peek, and ArrayDeque versus LinkedList.
kvi5hnuCode Sprout team member6 minLists for the OCP 21 exam: ArrayList versus LinkedList, Arrays.asList, List.of and List.copyOf, constructors, index-based methods, replaceAll, the overloaded remove trap, indexOf and lastIndexOf, IndexOutOfBoundsException, and converting lists to arrays.
kvi5hnuCode Sprout team member6 minThe Java Collections Framework for the OCP 21 exam: List, Set, Queue, Deque and Map, generics with the diamond operator and var, and the Collection methods add, remove, size, isEmpty, clear, contains, removeIf, forEach, iterators, equals and unboxing pitfalls.
kvi5hnuCode Sprout team member7 minVariables and lambdas for the OCP 21 exam: inferring parameter types, var, final and annotations on parameters, consistent parameter formats, locals inside lambda blocks and name clashes, and which instance, static and local variables a lambda body may reference.
kvi5hnuCode Sprout team member7 minCombining functional interfaces for the OCP 21 exam: Predicate and, or, negate and not, Function andThen versus compose, Consumer andThen, identity, then the primitive interfaces for int, long, double and boolean, their renamed methods, and the To and Obj variants.
kvi5hnuCode Sprout team member6 minThe core java.util.function interfaces for the OCP 21 exam: Supplier, Consumer, BiConsumer, Predicate, BiPredicate, Function, BiFunction, UnaryOperator and BinaryOperator, their method names, type parameters and return types, how to pick the right one, and common generic mistakes.
kvi5hnuCode Sprout team member6 minMethod references for the OCP 21 exam: the :: operator, static, bound and unbound instance method references, constructor and array constructor references, how the target type picks overloads, this:: and super::, ambiguous references, and when a lambda can't be rewritten.
kvi5hnuCode Sprout team member6 minFunctional interfaces for the OCP 21 exam: the single abstract method rule, what @FunctionalInterface checks, inherited and merged abstract methods, why default, static and private methods don't count, the Object-method exception, and what can't be a lambda target.
kvi5hnuCode Sprout team member6 minLambda syntax for the OCP 21 exam: why lambdas replace one-method classes, deferred execution, target typing, the optional parentheses, braces, return and semicolon, valid and invalid forms, var and typed parameters, void-compatible bodies, and why var can't hold a lambda.
kvi5hnuCode Sprout team member8 minPolymorphism for the OCP 21 exam: object type versus reference type, implicit upcasts and explicit downcasts, ClassCastException, casts the compiler rejects (including final, record and sealed types), instanceof patterns, virtual method calls, and hidden fields and static methods.
kvi5hnuCode Sprout team member8 minLocal and anonymous classes for the OCP 21 exam: classes inside methods, capturing effectively final locals, outer-instance access, anonymous subclasses and implementations, the trailing semicolon, local records, lambdas versus anonymous classes, and choosing a nested type.
kvi5hnuCode Sprout team member9 minMember-level nested classes for the OCP 21 exam: the four kinds of nested class, inner classes and the outer.new Inner() syntax, Outer.this for shadowed members, static nested classes, nested records, enums and interfaces that are implicitly static, modifiers and generated class files.
kvi5hnuCode Sprout team member6 min