Java OCA 1Z0-808 9.3b — Date-Time API, Period & DateTimeFormatter
Master the Java 8 Date-Time API for the Oracle Certified Associate Java SE 8 (1Z0-808) exam.
In this video, we cover:
✅ java.time package — all Date-Time classes are IMMUTABLE
✅ LocalDate — date without time, factory methods only, no constructors
✅ LocalTime — time without date
✅ LocalDateTime — date and time combined
✅ new LocalDate() — compile error, must use LocalDate.now() or LocalDate.of()
✅ LocalDate.of(year, month, day) — using int or Month enum
✅ The number one trap — date.plusDays(5) without capturing return, original unchanged
✅ Must capture return — LocalDate future = original.plusDays(5)
✅ Chaining — plusYears().plusMonths().plusDays() — each returns new object
✅ Period class — represents years, months and days
✅ Period.of(years, months, days) — argument order matters
✅ Period.ofWeeks(2) stores as P14D internally — not P2W
✅ Period cannot be added to LocalTime — UnsupportedTemporalTypeException at runtime
✅ DateTimeFormatter — predefined ISO_LOCAL_DATE and custom ofPattern
✅ Pattern symbols — y year, M month, d day, H hour 24h, m minute, s second
✅ date.format(formatter) and formatter.format(date) — both valid
✅ Wrong formatter for wrong type — UnsupportedTemporalTypeException at runtime not compile time
✅ Practice question with step-by-step trace at the end
This is Objective 9 of the OCA exam: "Working with Selected Classes from the Java API — Create and manipulate calendar data using classes from java.time."
📌 Part of our complete Java OCA 1Z0-808 series
✅ Completed: Chapter 1 — Java Basics
1.1 Java Class Structure — • Java OCA 1Z0 808 1 1 Java Class Structure
1.2 The main() Method — • Java OCA 1Z0 808 1 2 main Method
1.3 Scope of Variables — • Java OCA 1Z0-808 | 1.3 Define the Scope of...
1.4 Packages & Imports — • Java OCA 1Z0-808 | 1.4 Packages & Imports ...
1.5 Java Features — • Java OCA 1Z0-808 | 1.5 Java Features | Pla...
✅ Chapter 2 — Working with Java Data Types
2.1 Identifiers & Naming Conventions — • Master Java Identifiers & Naming Conventio...
2.2a Variables & Primitive Types — • Java OCA 1Z0-808 | 2.2a Variables & Primit...
2.2b Type Casting & Conversions — • Java OCA 1Z0-808 | 2.2b Type Casting & Con...
2.3 Object References & Object Lifecycle — • Java OCA 1Z0-808 | 2.3 Object References v...
2.4 Wrapper Classes — • Java OCA 1Z0-808 | 2.4 Wrapper Classes | A...
✅ Chapter 3 — Operators & Decision Constructs
3.1 Operator Precedence, Pre/Post Increment & Short-Circuit Logic — • 3.1 Operators in Java: Precedence, Increme...
3.2 == vs .equals(), String Pool Traps & Wrapper Comparison — • 3.2 == vs .equals(), String Pool Traps & W...
3.3 if/else, Ternary Operator & switch Statement — • 3.3 if-else, Ternary Operator & switch Sta...
✅ Chapter 4 — Arrays
4.1 Array Declaration, Initialization & Default Values — • 4.1 Array Declaration, Initialization & De...
4.2 Array Access, Bounds & Multi-Dimensional Arrays — • 4.2 Array Access, Bounds & Multi-Dimension...
4.3 Sorting, Searching & Arrays Utility Class — • 4.3 Sorting, Searching & Arrays Utility Cl...
✅ Chapter 5 — Loop Constructs
5.1 while, do-while & for Loops — • 5.1 while, do-while & for Loops | Java OCA...
5.2 Enhanced for, break, continue & Labeled Statements — • 5.2 Enhanced for Loop, break, continue & L...
✅ Chapter 6 — Methods & Encapsulation
6.1 Method Declaration, Overloading & Varargs — • 6.1 Method Declaration, Overloading & Vara...
6.2 Constructors, Static Members & Pass-by-Value — • 6.2 Constructors, Static Members & Pass-by...
6.3 Access Modifiers & Encapsulation — • 6.3 Access Modifiers & Encapsulation | Jav...
✅ Chapter 7 — Inheritance
7.1.1 Access Modifiers & Method Overriding Rules — • 7.1.1 Access Modifiers & Method Overriding...
7.1.2 Polymorphism & final Class — • 7.1.2 Polymorphism & final Class | Java OC...
7.2 Abstract Classes, Interfaces & Casting — • 7.2 Abstract Classes, Interfaces & Casting...
7.3 super, this, Covariant Returns & Override vs Hide — • 7.3 super, this, Covariant Returns & Overr...
✅ Chapter 8 — Exception Handling
8.1 Exception Hierarchy, try-catch-finally & Catch Order Rules — • 8.1 Exception Hierarchy, try-catch-finally...
8.2 Common Runtime Exceptions & Checked Exception Rules — • 8.2 Common Runtime Exceptions & Checked Ex...
8.3 finally & return Interaction, Nested try-catch & Exam Traps — • 8.3 finally & return Interaction, Nested t...
🔄 Chapter 9 — Core Java API Classes
9.1 String — Immutability, Key Methods & Concatenation Order Traps — • 9.1 String — Immutability, Key Methods & C...
9.2 StringBuilder — Mutability, Method Chaining & equals() Trap — • 9.2 StringBuilder — Mutability, Method Cha...
9.3a ArrayList — Declaration, Methods & remove() Trap — • 9.3a ArrayList — Declaration, Methods & re...
9.3b Date-Time API, Period & DateTimeFormatter ← THIS VIDEO
🔄 Chapter 10 — Lambda Expressions
10.1 Lambda Expressions & Predicate — Coming Next — FINAL VIDEO!
📢 For the complete OCA course — practice with our full platform:
🔗 1,624+ practice questions: https://javalearn.clustermicro.com
🎁 Free 30-question trial — no credit card needed