Skip to content

πŸ“š Comprehensive study guide for Oracle Certified Professional Java SE 17 Developer (1Z0-829) exam. 100+ documented examples covering all exam topics with working code, exam traps, and quick reference guides.

Notifications You must be signed in to change notification settings

caseythecoder90/java-ocp-17-study

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

34 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Java OCP 17 Study Guide

A comprehensive study repository for the Oracle Certified Professional: Java SE 17 Developer (1Z0-829) exam. This repository contains well-documented code examples, exam tips, common traps, and practical demonstrations for every topic covered in the OCP Java 17 certification.

πŸ“š Why This Repository?

  • Exam-Focused: Every example is designed with the exam in mind, highlighting common traps and edge cases
  • Comprehensive Coverage: All exam topics from the official Oracle study guide
  • Working Examples: All code compiles and runs, with output demonstrations
  • Clear Documentation: Extensive inline comments explaining concepts and exam tips
  • Quick Reference: Tables, comparisons, and checklists for rapid review
  • Best Practices: Follows Java 17 features and modern coding standards

🎯 Exam Topics Covered

Chapter 1: Building Blocks

Topics: Java basics, primitive types, text blocks, operators, and fundamental concepts

  • Text blocks (Java 13+)
  • Variable declarations and initialization
  • Primitive types and wrapper classes
  • Identifier naming rules

Chapter 2: Operators

Topics: All Java operators and operator precedence

  • Arithmetic, relational, and logical operators
  • Operator precedence and associativity
  • Short-circuit evaluation
  • Ternary operator

Chapter 3: Control Flow

Topics: Decision structures and loops

  • if/else statements
  • switch statements (traditional and enhanced)
  • for, while, and do-while loops
  • break, continue, and return

Chapter 4: Core APIs

Topics: String, StringBuilder, Arrays, Math, and common APIs

  • String manipulation and immutability
  • StringBuilder vs StringBuffer
  • Array operations
  • Math class methods
  • Date/Time API basics

Chapter 5: Methods

Topics: Method declarations, overloading, varargs

  • Method signatures and return types
  • Method overloading rules
  • Varargs (variable arguments)
  • Access modifiers
  • Static vs instance methods

Chapter 6: Inheritance

Topics: Class inheritance, polymorphism, abstract classes

  • extends keyword and inheritance hierarchy
  • Method overriding vs overloading
  • Abstract classes and methods
  • Polymorphism and casting
  • Object class methods

Chapter 7: Beyond Classes

Topics: Interfaces, enums, nested classes, sealed classes

  • Interface declarations and implementation
  • Default and static methods in interfaces
  • Private methods in interfaces
  • Enums with constructors and methods
  • Inner classes (static nested, inner, local, anonymous)
  • Sealed classes (Java 17)

Chapter 8: Lambdas and Functional Interfaces

Topics: Lambda expressions, method references, built-in functional interfaces

  • Lambda syntax and rules
  • Functional interface definitions
  • Method references (4 types)
  • Built-in functional interfaces (Predicate, Consumer, Supplier, Function)
  • Effectively final variables
  • Lambda parameter syntax including var (Java 11+)

Chapter 9: Collections and Generics

Topics: Collection framework, generics, comparators

  • Files:
    • CollectionsFramework.java - Overview of List, Set, Queue, Map
    • ListMethods.java - List operations and methods
    • SetMethods.java - Set implementations and methods
    • MapMethods.java - Map operations and methods
    • QueueAndDequeMethods.java - Queue/Deque operations
    • ComparableAndComparator.java - Sorting and comparison
    • GenericsAndTypeErasure.java - Generic types and type erasure
    • BoundingGenericTypes.java - Bounded wildcards (upper/lower bounds)

Chapter 10: Streams

Topics: Stream API, intermediate and terminal operations

  • Stream creation and operations
  • map, filter, reduce, collect
  • Optional class
  • Primitive streams
  • Stream pipeline evaluation

Chapter 11: Exceptions and Localization

Topics: Exception handling, try-with-resources, localization

  • Checked vs unchecked exceptions
  • try-catch-finally blocks
  • try-with-resources (AutoCloseable)
  • Multi-catch blocks
  • Custom exceptions
  • Localization and resource bundles

Chapter 12: Modules

Topics: Java Platform Module System (JPMS)

  • Module declarations
  • exports and requires
  • Module types
  • Module path vs classpath
  • Service loading

Chapter 13: Concurrency

Topics: Threads, concurrency utilities, parallel streams

  • Thread creation and lifecycle
  • ExecutorService and thread pools
  • Concurrent collections
  • Atomic classes
  • Locks and synchronization
  • Parallel streams

Chapter 14: I/O

Topics: File I/O, NIO.2, serialization

  • Files:
    • FileAndPathBasics.java - File and Path fundamentals
    • FilesOperations.java - Files class operations
    • NIO2Options.java - LinkOption, StandardCopyOption, StandardOpenOption
    • Stream-based I/O
    • File operations and directory walking

Chapter 15: JDBC ⭐

Topics: Database connectivity, SQL operations, transactions

  • Complete implementation with 7 files and comprehensive documentation
  • Files:
    1. JDBCBasics.java - JDBC URL, DriverManager, Connection
    2. PreparedStatementExamples.java - Execute methods, binding variables
    3. ResultSetExamples.java - Cursor navigation, getters
    4. CallableStatementExamples.java - Stored procedures, IN/OUT/INOUT
    5. TransactionsAndSavepoints.java - Transactions, commit, rollback, savepoints
    6. ClosingResources.java - Proper closing order, cascading close
    7. JDBCExamReference.java - Quick reference guide

See: src/ch15jdbc/README.md for detailed setup and usage

Key Exam Points:

  • JDBC URL format: jdbc:subprotocol:subname
  • Execute methods: executeUpdate(), executeQuery(), execute()
  • 1-based indexing (NOT 0-based!)
  • ResultSet cursor starts BEFORE first row
  • Closing order: ResultSet β†’ PreparedStatement β†’ Connection
  • Cascading close behavior
  • Transaction control and savepoints

πŸ“‚ Repository Structure

JavaOCP17/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ ch01buildingblocks/
β”‚   β”œβ”€β”€ ch02operators/
β”‚   β”œβ”€β”€ ch03controlflow/
β”‚   β”œβ”€β”€ ch04coreapis/
β”‚   β”œβ”€β”€ ch05methods/
β”‚   β”œβ”€β”€ ch06inheritance/
β”‚   β”œβ”€β”€ ch07beyondclasses/
β”‚   β”œβ”€β”€ ch08lambdasandfunctionalinterfaces/
β”‚   β”œβ”€β”€ ch09collectionsandgenerics/
β”‚   β”œβ”€β”€ ch10streams/
β”‚   β”œβ”€β”€ ch11exceptionsandlocalization/
β”‚   β”œβ”€β”€ ch12modules/
β”‚   β”œβ”€β”€ ch13concurrency/
β”‚   β”œβ”€β”€ ch14io/
β”‚   β”œβ”€β”€ ch15jdbc/          # Complete JDBC implementation
β”‚   β”‚   β”œβ”€β”€ README.md      # Detailed JDBC setup and examples
β”‚   β”‚   β”œβ”€β”€ JDBCBasics.java
β”‚   β”‚   β”œβ”€β”€ PreparedStatementExamples.java
β”‚   β”‚   β”œβ”€β”€ ResultSetExamples.java
β”‚   β”‚   β”œβ”€β”€ CallableStatementExamples.java
β”‚   β”‚   β”œβ”€β”€ TransactionsAndSavepoints.java
β”‚   β”‚   β”œβ”€β”€ ClosingResources.java
β”‚   β”‚   β”œβ”€β”€ JDBCExamReference.java
β”‚   β”‚   β”œβ”€β”€ stored-procedures.sql
β”‚   β”‚   └── setup-procedures.bat
β”‚   └── ch16jdbc/          # Additional JDBC examples
β”œβ”€β”€ lib/
β”‚   └── postgresql-42.7.1.jar  # JDBC driver for examples
β”œβ”€β”€ docker-compose.yml     # PostgreSQL database for JDBC
β”œβ”€β”€ init-db.sql           # Database initialization
└── README.md             # This file

πŸš€ Getting Started

Prerequisites

  • Java 17 or higher
  • Docker (for JDBC chapter examples)
  • Git

Clone the Repository

git clone https://github.com/caseythecoder90/java-ocp-17-study.git
cd java-ocp-17-study

Compile Examples

# Compile all Java files
javac src/**/*.java

# Or compile specific chapter
javac src/ch09collectionsandgenerics/*.java

Run Examples

# Run a specific example
java -cp src ch09collectionsandgenerics.BoundingGenericTypes

# For JDBC examples (requires classpath with driver)
java -cp "src;lib/*" ch15jdbc.JDBCBasics

JDBC Setup (Chapter 15)

JDBC examples require PostgreSQL running in Docker:

# Start database
docker-compose up -d

# Setup stored procedures (one-time)
docker exec -i jdbc-practice-db psql -U ocpuser -d ocp_practice < src/ch15jdbc/stored-procedures.sql

# Run JDBC examples
java -cp "src;lib/*" ch15jdbc.JDBCBasics

See src/ch15jdbc/README.md for detailed instructions.

πŸ“– How to Use This Repository

For First-Time Learners

  1. Read the code: Each file has extensive documentation explaining concepts
  2. Run the examples: See the output and understand behavior
  3. Modify and experiment: Change values and see what happens
  4. Note the exam traps: Pay special attention to comments marked "EXAM TRAP!"

For Exam Review

  1. Focus on comparison tables: Each chapter has tables comparing similar concepts
  2. Review exam traps: All common pitfalls are documented
  3. Practice with edge cases: Examples include boundary conditions
  4. Use quick reference files: Files like JDBCExamReference.java for rapid review

Study Approach

  1. Week 1-2: Chapters 1-5 (Fundamentals)
  2. Week 3-4: Chapters 6-8 (OOP and Lambdas)
  3. Week 5-6: Chapters 9-11 (Collections, Streams, Exceptions)
  4. Week 7-8: Chapters 12-14 (Modules, Concurrency, I/O)
  5. Week 9-10: Chapter 15 (JDBC) + Practice Exams
  6. Week 11: Review all exam traps and edge cases

πŸŽ“ Exam Day Checklist

Must Memorize

  • JDBC URL format: jdbc:subprotocol:subname
  • Execute method return types
  • 1-based indexing in JDBC (NOT 0-based)
  • ResultSet cursor starts BEFORE first row
  • Resource closing order (reverse of creation)
  • AutoCloseable and try-with-resources
  • Functional interface method counts
  • Collection framework hierarchy
  • Stream operations (intermediate vs terminal)
  • Module system basics

Common Exam Traps

  • Confusing executeUpdate() with executeQuery()
  • Using index 0 for JDBC parameters/columns
  • Forgetting ResultSet cursor starts before first row
  • Wrong closing order for JDBC resources
  • Modifying effectively final variables in lambdas
  • Confusing method overloading vs overriding
  • Array vs Collection operations
  • Checked vs unchecked exceptions

πŸ” Key Features

Comprehensive Documentation

Every file includes:

  • Detailed inline comments explaining each concept
  • Comparison tables for similar methods/concepts
  • Common exam traps clearly marked
  • Edge cases and boundary conditions
  • Expected output for each example

Exam-Focused Examples

  • Real exam scenarios: Examples mirror actual exam question patterns
  • Edge cases: Boundary conditions and special cases covered
  • Common mistakes: What NOT to do, with explanations
  • Quick reference: Tables and summaries for rapid review

Working Code

  • All examples compile with Java 17
  • All examples produce output (not just syntax demonstrations)
  • JDBC examples use real database (PostgreSQL in Docker)
  • No external dependencies except JDBC driver

πŸ’‘ Tips for Success

  1. Don't just read, code: Type out examples yourself
  2. Understand the "why": Don't memorize, understand the reasoning
  3. Focus on exam traps: These are heavily tested
  4. Practice with real code: Run examples and modify them
  5. Use comparison tables: Great for quick review
  6. Review edge cases: Exam loves boundary conditions
  7. Time yourself: Practice answering questions quickly

πŸ“ What's NOT on the Exam

To help you focus, here's what you can skip:

  • SQL syntax errors (only JDBC API is tested)
  • Statement interface (only PreparedStatement and CallableStatement)
  • DataSource (only DriverManager)
  • Batch updates
  • Advanced concurrency patterns
  • Complex regex patterns
  • GUI development
  • Network programming

🀝 Contributing

Found an error or want to add examples? Contributions are welcome!

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/improvement)
  3. Commit your changes (git commit -m 'Add improvement')
  4. Push to the branch (git push origin feature/improvement)
  5. Open a Pull Request

Please ensure:

  • Code compiles with Java 17
  • Examples include comprehensive documentation
  • Exam traps are clearly marked
  • Output is demonstrated

πŸ“Š Repository Statistics

  • Total Java Files: 100+
  • Chapters Covered: 15/15 (100%)
  • Lines of Documentation: Thousands
  • Working Examples: All files compile and run
  • Exam Topics: Complete coverage

πŸ™ Acknowledgments

This repository was created as a comprehensive study guide for the Oracle Certified Professional Java SE 17 Developer exam. Examples and documentation are based on:

  • Oracle's official Java SE 17 documentation
  • OCP Java SE 17 Developer Study Guide
  • Real exam practice questions and feedback
  • Personal exam preparation experience

πŸ“œ License

This repository is for educational purposes. Feel free to use for your exam preparation.

🎯 Final Notes

Good luck on your exam! Remember:

  • Understand, don't memorize
  • Practice with working code
  • Focus on exam traps
  • Review comparison tables
  • Test edge cases
  • Time management is key

For JDBC examples, see the detailed guide in src/ch15jdbc/README.md.


⭐ If this repository helped you pass the exam, consider giving it a star!

Last Updated: January 2026 Exam: Oracle Certified Professional: Java SE 17 Developer (1Z0-829)

About

πŸ“š Comprehensive study guide for Oracle Certified Professional Java SE 17 Developer (1Z0-829) exam. 100+ documented examples covering all exam topics with working code, exam traps, and quick reference guides.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages