Java SE 8 Programmer II study plan
Java SE 8 Programmer II · Give each week a clear focus.
8 weeks · About 7 hours per week
Generics and Collections & Advanced Java Class Design
Implement a generic Box class with bounded type parameters and a static generic factory method, then compile it against raw-type call sites to observe unchecked warnings
Write and trace a class hierarchy using abstract classes, interfaces with default methods, and static interface methods, resolving a diamond conflict manually
Build a comparator chain with Comparator.comparing(...).thenComparing(...) and sort a List by three fields in both directions
Choose between List, Set, Map, and Deque implementations for five stated scenarios and justify each choice in writing
Demonstrate covariant return types and polymorphic constructor dispatch in a small inheritance exercise
Your checkpoint
A single Maven-less project folder with a GenericsDemo and HierarchyDemo class plus a one-page written table mapping five scenarios to chosen collection types with justifications
Concurrency & Generics and Collections
Create threads via Runnable, Callable, and ExecutorService, and shut down a fixed thread pool without leaking threads
Synchronize a shared counter using synchronized blocks, then replace it with AtomicInteger and compare behavior under 8 threads
Use ConcurrentHashMap, CopyOnWriteArrayList, and a BlockingQueue to solve a producer-consumer task
Identify and fix a deadlock in a two-lock example by imposing a consistent lock ordering
Explain the difference between HashMap and ConcurrentHashMap iteration semantics in writing
Your checkpoint
A concurrency lab with three runnable programs (counter race, producer-consumer, deadlock fix) and console output proving the fixed versions produce correct totals across 10 runs
Concurrency & Java Stream API
Apply ForkJoinPool and RecursiveTask to sum a large array and measure speedup over a sequential loop
Use parallel streams on a stateless pipeline and demonstrate a correctness bug with a stateful lambda
Build a stream pipeline that filters, maps, sorts, and collects into a Map with Collectors.groupingBy and downstream counting
Chain Optional results from stream operations using map, flatMap, and orElseThrow
Compare intermediate and terminal operations by writing a pipeline that would not compile without a terminal operation
Your checkpoint
A StreamsAndParallel class producing a grouped report from a hardcoded list of 20 records, plus a short benchmark log comparing sequential and parallel sums
Java Stream API & Lambda Built-in Functional Interfaces
Implement all four core functional interfaces (Supplier, Consumer, Function, Predicate) as lambdas and as method references
Use primitive specializations IntStream, LongSupplier, and IntPredicate to avoid boxing in a numeric pipeline
Write custom functional interfaces annotated with @FunctionalInterface and trigger a compile error by adding a second abstract method
Compose predicates with and, or, and negate, and functions with andThen and compose
Use Collectors.partitioningBy, mapping, and joining to produce formatted text output from a stream
Your checkpoint
A LambdaDrills file with 15 numbered exercises, each a compiling snippet, plus a written key explaining which built-in interface each exercise targets
Using the Java I/O API & Java File I/O (NIO.2)
Read and write text files with BufferedReader, BufferedWriter, and Files.newBufferedReader using try-with-resources
Serialize and deserialize an object graph with ObjectOutputStream, marking one field transient and verifying its default value after read
Walk a directory tree with Files.walk and filter by extension, then delete empty directories with Files.deleteIfExists
Resolve and normalize paths with Paths.get, relativize, and toAbsolutePath, and explain the results for three sample paths
Copy, move, and read file attributes with Files.copy, Files.move, and Files.readAttributes
Your checkpoint
An IOToolkit class with four public methods (copyTree, listByExtension, serializeObject, readAllLines) and a main that exercises each against a temporary directory created at runtime
Exceptions and Assertions & Java Date/Time API
Write a custom checked exception and a custom unchecked exception, and wrap one in the other preserving the cause
Use multi-catch and try-with-resources with a custom AutoCloseable whose close method throws, ordering suppressed exceptions correctly
Enable assertions with -ea and use assert to validate a method precondition, documenting when assertions are inappropriate
Build LocalDate, LocalTime, and LocalDateTime values, then format and parse them with DateTimeFormatter patterns and locales
Convert between Instant, ZonedDateTime, and LocalDateTime across a DST boundary and explain the offset change
Your checkpoint
An exceptions-and-time worksheet: one program demonstrating suppressed exceptions with printed stack trace, and one program printing a formatted itinerary across a DST transition in two time zones
Building Database Applications with JDBC & Localization
Connect to an embedded or local database with DriverManager, then execute SELECT, INSERT, and UPDATE through PreparedStatement with parameters
Iterate a ResultSet with correct column-type getters and close resources in try-with-resources
Use a transaction with setAutoCommit(false), commit, and rollback on an induced failure
Externalize user-facing strings into ResourceBundle properties files for two locales and load them with a Locale
Format numbers and dates per locale using NumberFormat and DateTimeFormatter.withLocale
Your checkpoint
A JDBC-and-i18n demo: a small table created and queried from Java, plus the same console message printed correctly in en_US and fr_FR from bundled properties files
Java Class Design & Advanced Java Class Design
Review nested classes, static nested classes, and anonymous classes by refactoring one lambda-heavy class into each form
Re-implement an enum with fields, a constructor, and an abstract method per constant, and use EnumSet and EnumMap
Complete two timed 60-question mixed practice sets covering all twelve domains and log every miss by domain
Re-study the three weakest domains from the miss log and rewrite the corresponding code samples from memory
Write a one-page cheat sheet of API signatures you repeatedly forgot during practice
Your checkpoint
A scored practice log with per-domain accuracy percentages, a ranked list of the three weakest domains, and a cheat sheet of at least 20 API signatures