OCP Oracle Certified Professional Java SE 17 Developer (Exam 1Z0-829) Programmer's Guide

Book description

OCP Oracle Certified Professional Java SE 17 Developer Exam 1Z0-829 Programmer's Guide is a unique guide that combines a rigorous introduction to programming in Java with meticulous coverage of the Java SE 17 and Java SE 11 Developer exam objectives. Fully updated to reflect changes in the latest exams, it features increased focus on analyzing code scenarios--not just individual language constructs. Each objective is thoroughly addressed, reflecting the latest features and APIs, as well as best practices for taking the exam. The one book anyone studying for Java SE 17 Developer or Java SE 11 Developer certification needs, it features

  • Easy to find coverage of key topics relevant to each exam objective

  • An introduction to essential concepts in object-oriented programming (OOP) and functional-style programming

  • In-depth coverage of declarations, access control, operators, flow control, OOP techniques, lambda expressions, streams, modules, concurrency, Java I/O, key API classes and much more

  • Program output demonstrating expected results from complete Java programs

  • Unique diagrams to illustrate important concepts, such as Java I/O, modules, and streams

  • Extensive use of UML (Unified Modeling Language) to illustrate program design

  • Dozens of review questions with annotated answers to help prepare for the exam and a complete Mock Exam

Table of contents

  1. Cover Page
  2. Title Page
  3. Contents
  4. Table of Contents
  5. Figures
  6. Tables
  7. Examples
  8. Foreword
  9. Preface
    1. Writing This Book
    2. About This Book
    3. Using This Book
    4. Review Questions
    5. Book Website
    6. Request for Feedback
    7. About the Authors
    8. Acknowledgments
  10. 1. Basics of Java Programming
    1. 1.1 The Java Ecosystem
    2. 1.2 Classes
    3. 1.3 Objects
    4. 1.4 Instance Members
    5. 1.5 Static Members
    6. 1.6 Inheritance
    7. 1.7 Aggregation
    8. Review Questions
    9. 1.8 Sample Java Program
    10. 1.9 Program Output
    11. Review Questions
  11. 2. Basic Elements, Primitive Data Types, and Operators
    1. 2.1 Basic Language Elements
    2. 2.2 Primitive Data Types
    3. 2.3 Conversions
    4. 2.4 Type Conversion Contexts
    5. 2.5 Precedence and Associativity Rules for Operators
    6. 2.6 Evaluation Order of Operands
    7. 2.7 The Simple Assignment Operator =
    8. 2.8 Arithmetic Operators: *, /, %, +, -
    9. 2.9 The Binary String Concatenation Operator +
    10. 2.10 Variable Increment and Decrement Operators: ++, --
    11. Review Questions
    12. 2.11 Boolean Expressions
    13. 2.12 Relational Operators: <, <=, >, >=
    14. 2.13 Equality
    15. 2.14 Boolean Logical Operators: !, ^, &, |
    16. 2.15 Conditional Operators: &&, ||
    17. 2.16 Integer Bitwise Operators: ~, &, |, ^
    18. 2.17 Shift Operators: <<, >>, >>>
    19. 2.18 The Conditional Operator ?:
    20. 2.19 Other Operators: new, [], instanceof, ->
    21. Review Questions
  12. 3. Declarations
    1. 3.1 Class Declarations
    2. 3.2 Method Declarations
    3. 3.3 Statements
    4. 3.4 Variable Declarations
    5. 3.5 Instance Methods and the Object Reference this
    6. 3.6 Method Overloading
    7. 3.7 Constructors
    8. 3.8 Static Member Declarations
    9. Review Questions
    10. 3.9 Arrays
    11. 3.10 Parameter Passing
    12. 3.11 Variable Arity Methods
    13. 3.12 The main() Method
    14. 3.13 Local Variable Type Inference
    15. Review Questions
  13. 4. Control Flow
    1. 4.1 Selection Statements
    2. 4.2 The switch Statement
    3. 4.3 The switch Expression
    4. Review Questions
    5. 4.4 Iteration Statements
    6. 4.5 The while Statement
    7. 4.6 The do-while Statement
    8. 4.7 The for(;;) Statement
    9. 4.8 The for(:) Statement
    10. 4.9 Transfer Statements
    11. 4.10 Labeled Statements
    12. 4.11 The break Statement
    13. 4.12 The continue Statement
    14. 4.13 The return Statement
    15. Review Questions
  14. 5. Object-Oriented Programming
    1. 5.1 Implementing Inheritance
    2. 5.2 The Object Reference super
    3. 5.3 Chaining Constructors Using this() and super()
    4. Review Questions
    5. 5.4 Abstract Classes and Methods
    6. 5.5 Final Declarations
    7. Review Questions
    8. 5.6 Interfaces
    9. Review Questions
    10. 5.7 Arrays and Subtyping
    11. 5.8 Reference Values and Conversions
    12. 5.9 Reference Value Assignment Conversions
    13. 5.10 Method Invocation Conversions Involving References
    14. 5.11 Reference Casting and the instanceof Operator
    15. 5.12 Polymorphism
    16. Review Questions
    17. 5.13 Enum Types
    18. 5.14 Record Classes
    19. 5.15 Sealed Classes and Interfaces
    20. Review Questions
  15. 6. Access Control
    1. 6.1 Design Principle: Encapsulation
    2. 6.2 Java Source File Structure
    3. 6.3 Packages
    4. 6.4 Searching for Classes on the Class Path
    5. Review Questions
    6. 6.5 Access Modifiers
    7. 6.6 Scope Rules
    8. 6.7 Implementing Immutability
    9. Review Questions
  16. 7. Exception Handling
    1. 7.1 Stack-Based Execution and Exception Propagation
    2. 7.2 Exception Types
    3. 7.3 Exception Handling: try, catch, and finally
    4. 7.4 The throw Statement
    5. 7.5 The throws Clause
    6. Review Questions
    7. 7.6 The Multi-catch Clause
    8. 7.7 The try-with-resources Statement
    9. 7.8 Advantages of Exception Handling
    10. Review Questions
  17. 8. Selected API Classes
    1. 8.1 Overview of the java.lang Package
    2. 8.2 The Object Class
    3. 8.3 The Wrapper Classes
    4. Review Questions
    5. 8.4 The String Class
    6. 8.5 The StringBuilder Class
    7. Review Questions
    8. 8.6 The Math Class
    9. 8.7 The Random Class
    10. 8.8 Using Big Numbers
    11. Review Questions
  18. 9. Nested Type Declarations
    1. 9.1 Overview of Nested Type Declarations
    2. 9.2 Static Member Types
    3. 9.3 Non-Static Member Classes
    4. Review Questions
    5. 9.4 Local Classes
    6. 9.5 Static Local Types
    7. 9.6 Anonymous Classes
    8. Review Questions
  19. 10. Object Lifetime
    1. 10.1 Garbage Collection
    2. 10.2 Reachable Objects
    3. 10.3 Facilitating Garbage Collection
    4. 10.4 Invoking Garbage Collection Programmatically
    5. Review Questions
    6. 10.5 Initializers
    7. 10.6 Field Initializer Expressions
    8. 10.7 Static Initializer Blocks
    9. 10.8 Instance Initializer Blocks
    10. 10.9 Constructing Initial Object State
    11. Review Questions
  20. 11. Generics
    1. 11.1 Introducing Generics
    2. 11.2 Generic Types and Parameterized Types
    3. 11.3 Collections and Generics
    4. 11.4 Wildcards
    5. 11.5 Using References of Wildcard Parameterized Types
    6. 11.6 Bounded Type Parameters
    7. 11.7 Generic Methods and Constructors
    8. 11.8 Implementing a Simplified Generic Stack
    9. Review Questions
    10. 11.9 Wildcard Capture
    11. 11.10 Flexibility with Wildcard Parameterized Types
    12. 11.11 Type Erasure
    13. 11.12 Implications for Overloading and Overriding
    14. 11.13 Limitations and Restrictions on Generic Types
    15. Review Questions
  21. 12. Collections, Part I: ArrayList<E>
    1. 12.1 Lists
    2. 12.2 Declaring References and Constructing ArrayLists
    3. 12.3 Modifying an ArrayList<E>
    4. 12.4 Querying an ArrayList<E>
    5. 12.5 Iterating Over an ArrayList<E>
    6. 12.6 Converting an ArrayList<E> to an Array
    7. 12.7 Creating List Views
    8. 12.8 Arrays versus ArrayLists
    9. Review Questions
  22. 13. Functional-Style Programming
    1. 13.1 Functional Interfaces
    2. 13.2 Lambda Expressions
    3. 13.3 Lambda Expressions and Anonymous Classes
    4. Review Questions
    5. 13.4 Overview of Built-In Functional Interfaces
    6. 13.5 Suppliers
    7. 13.6 Predicates
    8. 13.7 Consumers
    9. 13.8 Functions
    10. 13.9 Two-Arity Specialization of Function<T,R>: BiFunction<T,U,R>
    11. 13.10 Extending Function<T,T>: UnaryOperator<T>
    12. 13.11 Extending BiFunction<T,T,T>: BinaryOperator<T>
    13. 13.12 Currying Functions
    14. 13.13 Method and Constructor References
    15. 13.14 Contexts for Defining Lambda Expressions
    16. Review Questions
  23. 14. Object Comparison
    1. 14.1 The Objects Class
    2. 14.2 Implementing the equals() Method
    3. 14.3 Implementing the hashCode() Method
    4. 14.4 Implementing the java.lang.Comparable<E> Interface
    5. 14.5 Implementing the java.util.Comparator<E> Interface
    6. Review Questions
  24. 15. Collections: Part II
    1. 15.1 The Java Collections Framework
    2. 15.2 Collections
    3. 15.3 Lists
    4. 15.4 Sets
    5. 15.5 Sorted Sets and Navigable Sets
    6. 15.6 Queues
    7. 15.7 Deques
    8. Review Questions
    9. 15.8 Maps
    10. 15.9 Map Implementations
    11. 15.10 Sorted Maps and Navigable Maps
    12. Review Questions
    13. 15.11 The Collections Class
    14. 15.12 The Arrays Class
    15. Review Questions
  25. 16. Streams
    1. 16.1 Introduction to Streams
    2. 16.2 Running Example: The CD Record Class
    3. 16.3 Stream Basics
    4. 16.4 Building Streams
    5. 16.5 Intermediate Stream Operations
    6. 16.6 The Optional Class
    7. 16.7 Terminal Stream Operations
    8. 16.8 Collectors
    9. 16.9 Parallel Streams
    10. Review Questions
  26. 17. Date and Time
    1. 17.1 Date and Time API Overview
    2. 17.2 Working with Dates and Times
    3. 17.3 Using Temporal Units and Temporal Fields
    4. 17.4 Working with Instants
    5. 17.5 Working with Periods
    6. 17.6 Working with Durations
    7. 17.7 Working with Time Zones and Daylight Savings
    8. 17.8 Converting Date and Time Values to Legacy Date
    9. Review Questions
  27. 18. Localization
    1. 18.1 Using Locales
    2. 18.2 Properties Files
    3. 18.3 Bundling Resources
    4. Review Questions
    5. 18.4 Core API for Formatting and Parsing of Values
    6. 18.5 Formatting and Parsing Number, Currency, and Percentage Values
    7. 18.6 Formatting and Parsing Date and Time
    8. 18.7 Formatting and Parsing Messages
    9. Review Questions
  28. 19. Java Module System
    1. 19.1 Making the Case for Modules
    2. 19.2 The Modular JDK
    3. 19.3 Module Basics
    4. 19.4 Overview of Module Directives
    5. 19.5 Creating a Modular Application
    6. 19.6 Compiling and Running a Modular Application
    7. 19.7 Creating JAR Files
    8. 19.8 Open Modules and the opens Directive
    9. 19.9 Services
    10. 19.10 Creating Runtime Images
    11. 19.11 Categories of Modules
    12. 19.12 Migrating to Modules
    13. 19.13 Exploring Modules
    14. 19.14 Summary of Selected Operations with the JDK Tools
    15. Review Questions
  29. 20. Java I/O: Part I
    1. 20.1 Input and Output
    2. 20.2 Byte Streams: Input Streams and Output Streams
    3. 20.3 Character Streams: Readers and Writers
    4. 20.4 The Console Class
    5. Review Questions
    6. 20.5 Object Serialization
    7. Review Questions
  30. 21. Java I/O: Part II
    1. 21.1 Characteristics of a Hierarchical File System
    2. 21.2 Creating Path Objects
    3. 21.3 Working with Path Objects
    4. 21.4 Operations on Directory Entries
    5. 21.5 Reading and Writing Files Using Paths
    6. 21.6 Managing File Attributes
    7. 21.7 Creating Directory Entries
    8. 21.8 Stream Operations on Directory Entries
    9. Review Questions
  31. 22. Concurrency: Part I
    1. 22.1 Threads and Concurrency
    2. 22.2 Runtime Organization for Thread Execution
    3. 22.3 Creating Threads
    4. Review Questions
    5. 22.4 Thread Lifecycle
    6. 22.5 Thread Issues
    7. Review Questions
  32. 23. Concurrency: Part II
    1. 23.1 Utility Classes TimeUnit and ThreadLocalRandom
    2. 23.2 The Executor Framework
    3. 23.3 The Fork/Join Framework
    4. 23.4 Writing Thread-Safe Code
    5. 23.5 Special-Purpose Synchronizers
    6. 23.6 Synchronized Collections and Maps
    7. 23.7 Concurrent Collections and Maps
    8. Review Questions
  33. 24. Database Connectivity
    1. 24.1 Introduction to Relational Databases
    2. 24.2 Introduction to JDBC
    3. 24.3 Establishing a Database Connection
    4. 24.4 Creating and Executing SQL Statements
    5. 24.5 Processing Query Results
    6. 24.6 Customizing Result Sets
    7. 24.7 Discovering Database and ResultSet Metadata
    8. 24.8 Implementing Transaction Control
    9. Review Questions
  34. 25. Annotations
    1. 25.1 Basics of Annotations
    2. 25.2 Declaring Annotation Types
    3. 25.3 Applying Annotations
    4. 25.4 Meta-Annotations
    5. 25.5 Selected Standard Annotations
    6. 25.6 Processing Annotations
    7. Review Questions
  35. 26. Secure Coding
    1. 26.1 Application Security Overview
    2. 26.2 Security Threat Categories
    3. 26.3 Java Security Policies
    4. 26.4 Additional Security Guidelines
    5. Review Questions
  36. A. Taking the Java SE 17 and Java SE 11 Developer Exams
    1. A.1 Preparing for the Exam
    2. A.2 Registering for the Exam
    3. A.3 How the Exam Is Conducted
    4. A.4 The Questions
  37. B. Exam Topics: Java SE 17 Developer
  38. C. Exam Topics: Java SE 11 Developer
  39. D. Annotated Answers to Review Questions
    1. 1 Basics of Java Programming
    2. 2 Basic Elements, Primitive Data Types, and Operators
    3. 3 Declarations
    4. 4 Control Flow
    5. 5 Object-Oriented Programming
    6. 6 Access Control
    7. 7 Exception Handling
    8. 8 Selected API Classes
    9. 9 Nested Type Declarations
    10. 10 Object Lifetime
    11. 11 Generics
    12. 12 Collections, Part I: ArrayList<E>
    13. 13 Functional-Style Programming
    14. 14 Object Comparison
    15. 15 Collections: Part II
    16. 16 Streams
    17. 17 Date and Time
    18. 18 Localization
    19. 19 Java Module System
    20. 20 Java I/O: Part I
    21. 21 Java I/O: Part II
    22. 22 Concurrency: Part I
    23. 23 Concurrency: Part II
    24. 24 Database Connectivity
    25. 25 Annotations
    26. 26 Secure Coding
  40. E. Mock Exam: Java SE 17 Developer
    1. Questions
  41. F. Annotated Answers to Mock Exam
    1. Annotated Answers
  42. G. Java Logging API Overview
    1. G.1 Purpose of the Logging API
    2. G.2 Configuring Logging
    3. G.3 Writing Log Messages
    4. G.4 Applying Guarded Logging
    5. G.5 Summary

Product information

  • Title: OCP Oracle Certified Professional Java SE 17 Developer (Exam 1Z0-829) Programmer's Guide
  • Author(s): Khalid A. Mughal, Vasily A. Strelnikov
  • Release date: February 2023
  • Publisher(s): Oracle Press
  • ISBN: 9780137993857