DESCRIPTION
-----------
An effective and practical study aid to the new OCP Java SE 17 Developer certification exam
In the OCP Oracle Certified Professional Java SE 17 Developer Study Guide: Exam 1Z0-829, you’ll find accessible and essential test prep material for the in-demand and practical OCP Java SE 17 Developer certification. Providing comprehensive coverage of all OCP Java SE 17 exam objectives and competencies, the Study Guide offers you access to all the skills and knowledge you’ll need to succeed on the test and in the field as a new or experienced Java developer.
This book provides material on records, sealed classes, text blocks, dates, streams, controlling program flow, using the Java object-oriented approach, handling exceptions, working with arrays and collections, and more. You’ll also get:-
Intuitively organized information that aligns with the competencies tested on the exam and those required by real-world Java developers
Opportunities to practice and develop skills that remain in high demand in the IT industry
Access to the Sybex online learning center, with chapter review questions, full-length practice exams, hundreds of electronic flashcards, and a glossary of key terms
Perfect for anyone prepping for the brand-new OCP Java SE 17 credential,OCP Oracle Certified Professional Java SE 17
Developer Study Guide: Exam 1Z0-829 is also a can’t-miss reference for practicing and aspiring Java developers seeking to learn or reinforce their foundational skills in Java programming and improve their performance on the job.
=====================
ABOUT THE AUTHORS
-----------------
Scott Selikoff has been a professional Java Enterprise architect for over 20 years. He currently works as a Staff Software Engineer at Google, specializing in Architecture and Cloud Services. He is a Leader of the Garden State Java User Group, helping to facilitate discussions and exchange of ideas within the community.
Jeanne Boyarsky is a Java Champion and has worked as a Java developer for a major bank for more than 20 years. She is a senior moderator at CodeRanch, and trains and mentors students of all levels, including the programming department of a FIRST robotics team.
Author(s): Jeanne Boyarsky, Scott Selikoff
Publisher: Sybex
Year: 2022
Language: English
Pages: 1056
Tags: java openjdk java17 object-oriented uml analysis design microservices web apps
Cover
Title Page
Copyright Page
Contents at a Glance
Contents
Introduction
Understanding the Exam
Reading This Book
Studying for the Exam
Applying Test-Taking Strategies
Taking the Exam
Objective Map
Assessment Test
Chapter 1 Building Blocks
Learning about the Environment
Major Components of Java
Downloading a JDK
Understanding the Class Structure
Fields and Methods
Comments
Classes and Source Files
Writing a main() Method
Creating a main() Method
Passing Parameters to a Java Program
Understanding Package Declarations and Imports
Packages
Wildcards
Redundant Imports
Naming Conflicts
Creating a New Package
Compiling and Running Code with Packages
Compiling to Another Directory
Compiling with JAR Files
Creating a JAR File
Ordering Elements in a Class
Creating Objects
Calling Constructors
Reading and Writing Member Fields
Executing Instance Initializer Blocks
Following the Order of Initialization
Understanding Data Types
Using Primitive Types
Using Reference Types
Distinguishing between Primitives and Reference Types
Creating Wrapper Classes
Defining Text Blocks
Declaring Variables
Identifying Identifiers
Declaring Multiple Variables
Initializing Variables
Creating Local Variables
Passing Constructor and Method Parameters
Defining Instance and Class Variables
Inferring the Type with var
Managing Variable Scope
Limiting Scope
Tracing Scope
Applying Scope to Classes
Reviewing Scope
Destroying Objects
Understanding Garbage Collection
Tracing Eligibility
Summary
Exam Essentials
Review Questions
Chapter 2 Operators
Understanding Java Operators
Types of Operators
Operator Precedence
Applying Unary Operators
Complement and Negation Operators
Increment and Decrement Operators
Working with Binary Arithmetic Operators
Arithmetic Operators
Numeric Promotion
Assigning Values
Assignment Operator
Casting Values
Compound Assignment Operators
Return Value of Assignment Operators
Comparing Values
Equality Operators
Relational Operators
Logical Operators
Conditional Operators
Making Decisions with the Ternary Operator
Summary
Exam Essentials
Review Questions
Chapter 3 Making Decisions
Creating Decision-Making Statements
Statements and Blocks
The if Statement
The else Statement
Shortening Code with Pattern Matching
Applying switch Statements
The switch Statement
The switch Expression
Writing while Loops
The while Statement
The do/while Statement
Infinite Loops
Constructing for Loops
The for Loop
The for-each Loop
Controlling Flow with Branching
Nested Loops
Adding Optional Labels
The break Statement
The continue Statement
The return Statement
Unreachable Code
Reviewing Branching
Summary
Exam Essentials
Review Questions
Chapter 4 Core APIs
Creating and Manipulating Strings
Concatenating
Important String Methods
Method Chaining
Using the StringBuilder Class
Mutability and Chaining
Creating a StringBuilder
Important StringBuilder Methods
Understanding Equality
Comparing equals() and ==
The String Pool
Understanding Arrays
Creating an Array of Primitives
Creating an Array with Reference Variables
Using an Array
Sorting
Searching
Comparing
Using Methods with Varargs
Working with Multidimensional Arrays
Calculating with Math APIs
Finding the Minimum and Maximum
Rounding Numbers
Determining the Ceiling and Floor
Calculating Exponents
Generating Random Numbers
Working with Dates and Times
Day vs. Date
Creating Dates and Times
Manipulating Dates and Times
Working with Periods
Working with Durations
Period vs. Duration
Working with Instants
Accounting for Daylight Saving Time
Summary
Exam Essentials
Review Questions
Chapter 5 Methods
Designing Methods
Access Modifiers
Optional Specifiers
Return Type
Method Name
Parameter List
Method Signature
Exception List
Method Body
Declaring Local and Instance Variables
Local Variable Modifiers
Effectively Final Variables
Instance Variable Modifiers
Working with Varargs
Creating Methods with Varargs
Calling Methods with Varargs
Accessing Elements of a Vararg
Using Varargs with Other Method Parameters
Applying Access Modifiers
Private Access
Package Access
Protected Access
Public Access
Reviewing Access Modifiers
Accessing static Data
Designing static Methods and Variables
Accessing a static Variable or Method
Class vs. Instance Membership
static Variable Modifiers
static Initializers
static Imports
Passing Data among Methods
Passing Objects
Returning Objects
Autoboxing and Unboxing Variables
Overloading Methods
Reference Types
Primitives
Autoboxing
Arrays
Varargs
Putting It All Together
Summary
Exam Essentials
Review Questions
Chapter 6 Class Design
Understanding Inheritance
Declaring a Subclass
Class Modifiers
Single vs. Multiple Inheritance
Inheriting Object
Creating Classes
Extending a Class
Applying Class Access Modifiers
Accessing the this Reference
Calling the super Reference
Declaring Constructors
Creating a Constructor
The Default Constructor
Calling Overloaded Constructors with this()
Calling Parent Constructors with super()
Initializing Objects
Initializing Classes
Initializing final Fields
Initializing Instances
Inheriting Members
Overriding a Method
Redeclaring private Methods
Hiding Static Methods
Hiding Variables
Writing final Methods
Creating Abstract Classes
Introducing Abstract Classes
Declaring Abstract Methods
Creating a Concrete Class
Creating Constructors in Abstract Classes
Spotting Invalid Declarations
Creating Immutable Objects
Declaring an Immutable Class
Performing a Defensive Copy
Summary
Exam Essentials
Review Questions
Chapter 7 Beyond Classes
Implementing Interfaces
Declaring and Using an Interface
Extending an Interface
Inheriting an Interface
Inserting Implicit Modifiers
Declaring Concrete Interface Methods
Working with Enums
Creating Simple Enums
Using Enums in switch Statements
Adding Constructors, Fields, and Methods
Sealing Classes
Declaring a Sealed Class
Compiling Sealed Classes
Specifying the Subclass Modifier
Omitting the permits Clause
Sealing Interfaces
Reviewing Sealed Class Rules
Encapsulating Data with Records
Understanding Encapsulation
Applying Records
Understanding Record Immutability
Declaring Constructors
Customizing Records
Creating Nested Classes
Declaring an Inner Class
Creating a static Nested Class
Writing a Local Class
Defining an Anonymous Class
Reviewing Nested Classes
Understanding Polymorphism
Object vs. Reference
Casting Objects
The instanceof Operator
Polymorphism and Method Overriding
Overriding vs. Hiding Members
Summary
Exam Essentials
Review Questions
Chapter 8 Lambdas and Functional Interfaces
Writing Simple Lambdas
Looking at a Lambda Example
Learning Lambda Syntax
Coding Functional Interfaces
Defining a Functional Interface
Adding Object Methods
Using Method References
Calling static Methods
Calling Instance Methods on a Particular Object
Calling Instance Methods on a Parameter
Calling Constructors
Reviewing Method References
Working with Built-in Functional Interfaces
Implementing Supplier
Implementing Consumer and BiConsumer
Implementing Predicate and BiPredicate
Implementing Function and BiFunction
Implementing UnaryOperator and BinaryOperator
Checking Functional Interfaces
Using Convenience Methods on Functional Interfaces
Learning the Functional Interfaces for Primitives
Working with Variables in Lambdas
Listing Parameters
Using Local Variables Inside a Lambda Body
Referencing Variables from the Lambda Body
Summary
Exam Essentials
Review Questions
Chapter 9 Collections and Generics
Using Common Collection APIs
Using the Diamond Operator
Adding Data
Removing Data
Counting Elements
Clearing the Collection
Check Contents
Removing with Conditions
Iterating
Determining Equality
Using the List Interface
Comparing List Implementations
Creating a List with a Factory
Creating a List with a Constructor
Working with List Methods
Converting from List to an Array
Using the Set Interface
Comparing Set Implementations
Working with Set Methods
Using the Queue and Deque Interfaces
Comparing Deque Implementations
Working with Queue and Deque Methods
Using the Map Interface
Comparing Map Implementations
Working with Map Methods
Calling Basic Methods
Iterating through a Map
Getting Values Safely
Replacing Values
Putting if Absent
Merging Data
Comparing Collection Types
Sorting Data
Creating a Comparable Class
Comparing Data with a Comparator
Comparing Comparable and Comparator
Comparing Multiple Fields
Sorting and Searching
Sorting a List
Working with Generics
Creating Generic Classes
Understanding Type Erasure
Implementing Generic Interfaces
Writing Generic Methods
Creating a Generic Record
Bounding Generic Types
Putting It All Together
Summary
Exam Essentials
Review Questions
Chapter 10 Streams
Returning an Optional
Creating an Optional
Dealing with an Empty Optional
Using Streams
Understanding the Pipeline Flow
Creating Stream Sources
Using Common Terminal Operations
Using Common Intermediate Operations
Putting Together the Pipeline
Working with Primitive Streams
Creating Primitive Streams
Mapping Streams
Using Optional with Primitive Streams
Summarizing Statistics
Working with Advanced Stream Pipeline Concepts
Linking Streams to the Underlying Data
Chaining Optionals
Using a Spliterator
Collecting Results
Summary
Exam Essentials
Review Questions
Chapter 11 Exceptions and Localization
Understanding Exceptions
The Role of Exceptions
Understanding Exception Types
Throwing an Exception
Calling Methods That Throw Exceptions
Overriding Methods with Exceptions
Printing an Exception
Recognizing Exception Classes
RuntimeException Classes
Checked Exception Classes
Error Classes
Handling Exceptions
Using try and catch Statements
Chaining catch Blocks
Applying a Multi-catch Block
Adding a finally Block
Automating Resource Management
Introducing Try-with-Resources
Basics of Try-with-Resources
Applying Effectively Final
Understanding Suppressed Exceptions
Formatting Values
Formatting Numbers
Formatting Dates and Times
Customizing the Date/Time Format
Supporting Internationalization and Localization
Picking a Locale
Localizing Numbers
Localizing Dates
Specifying a Locale Category
Loading Properties with Resource Bundles
Creating a Resource Bundle
Picking a Resource Bundle
Selecting Resource Bundle Values
Formatting Messages
Using the Properties Class
Summary
Exam Essentials
Review Questions
Chapter 12 Modules
Introducing Modules
Exploring a Module
Benefits of Modules
Creating and Running a Modular Program
Creating the Files
Compiling Our First Module
Running Our First Module
Packaging Our First Module
Updating Our Example for Multiple Modules
Updating the Feeding Module
Creating a Care Module
Creating the Talks Module
Creating the Staff Module
Diving into the Module Declaration
Exporting a Package
Requiring a Module Transitively
Opening a Package
Creating a Service
Declaring the Service Provider Interface
Creating a Service Locator
Invoking from a Consumer
Adding a Service Provider
Reviewing Directives and Services
Discovering Modules
Identifying Built-in Modules
Getting Details with java
Describing with jar
Learning about Dependencies with jdeps
Using the --jdk-internals Flag
Using Module Files with jmod
Creating Java Runtimes with jlink
Reviewing Command-Line Options
Comparing Types of Modules
Named Modules
Automatic Modules
Unnamed Modules
Reviewing Module Types
Migrating an Application
Determining the Order
Exploring a Bottom-Up Migration Strategy
Exploring a Top-Down Migration Strategy
Splitting a Big Project into Modules
Failing to Compile with a Cyclic Dependency
Summary
Exam Essentials
Review Questions
Chapter 13 Concurrency
Introducing Threads
Understanding Thread Concurrency
Creating a Thread
Distinguishing Thread Types
Managing a Thread’s Life Cycle
Polling with Sleep
Interrupting a Thread
Creating Threads with the Concurrency API
Introducing the Single-Thread Executor
Shutting Down a Thread Executor
Submitting Tasks
Waiting for Results
Scheduling Tasks
Increasing Concurrency with Pools
Writing Thread-Safe Code
Understanding Thread-Safety
Accessing Data with volatile
Protecting Data with Atomic Classes
Improving Access with synchronized Blocks
Synchronizing on Methods
Understanding the Lock Framework
Orchestrating Tasks with a CyclicBarrier
Using Concurrent Collections
Understanding Memory Consistency Errors
Working with Concurrent Classes
Obtaining Synchronized Collections
Identifying Threading Problems
Understanding Liveness
Managing Race Conditions
Working with Parallel Streams
Creating Parallel Streams
Performing a Parallel Decomposition
Processing Parallel Reductions
Summary
Exam Essentials
Review Questions
Chapter 14 I/O
Referencing Files and Directories
Conceptualizing the File System
Creating a File or Path
Operating on File and Path
Using Shared Functionality
Handling Methods That Declare IOException
Providing NIO.2 Optional Parameters
Interacting with NIO.2 Paths
Creating, Moving, and Deleting Files and Directories
Comparing Files with isSameFile() and mismatch()
Introducing I/O Streams
Understanding I/O Stream Fundamentals
Learning I/O Stream Nomenclature
Reading and Writing Files
Using I/O Streams
Enhancing with Files
Combining with newBufferedReader() and newBufferedWriter()
Reviewing Common Read and Write Methods
Serializing Data
Applying the Serializable Interface
Marking Data transient
Ensuring That a Class Is Serializable
Storing Data with ObjectOutputStream and ObjectInputStream
Understanding the Deserialization Creation Process
Interacting with Users
Printing Data to the User
Reading Input as an I/O Stream
Closing System Streams
Acquiring Input with Console
Working with Advanced APIs
Manipulating Input Streams
Discovering File Attributes
Traversing a Directory Tree
Searching a Directory
Review of Key APIs
Summary
Exam Essentials
Review Questions
Chapter 15 JDBC
Introducing Relational Databases and SQL
Identifying the Structure of a Relational Database
Writing Basic SQL Statements
Introducing the Interfaces of JDBC
Connecting to a Database
Building a JDBC URL
Getting a Database Connection
Working with a PreparedStatement
Little Bobby Tables
Obtaining a PreparedStatement
Executing a PreparedStatement
Working with Parameters
Updating Multiple Records
Getting Data from a ResultSet
Reading a ResultSet
Getting Data for a Column
Using Bind Variables
Calling a CallableStatement
Calling a Procedure without Parameters
Passing an IN Parameter
Returning an OUT Parameter
Working with an INOUT Parameter
Comparing Callable Statement Parameters
Using Additional Options
Controlling Data with Transactions
Committing and Rolling Back
Bookmarking with Savepoints
Reviewing Transaction APIs
Closing Database Resources
Summary
Exam Essentials
Review Questions
Appendix Answers to the Review Questions
Chapter 1: Building Blocks
Chapter 2: Operators
Chapter 3: Making Decisions
Chapter 4: Core APIs
Chapter 5: Methods
Chapter 6: Class Design
Chapter 7: Beyond Classes
Chapter 8: Lambdas and Functional Interfaces
Chapter 9: Collections and Generics
Chapter 10: Streams
Chapter 11: Exceptions and Localization
Chapter 12: Modules
Chapter 13: Concurrency
Chapter 14: I/O
Chapter 15: JDBC
Index
EULA