Also covers OCP Java SE 11 Developer Exam (1Z0-819)               

Table of Contents (Volume I & Volume II)

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

Khalid A. Mughal   •   Vasily A. Strelnikov