Please enable JavaScript.
Coggle requires JavaScript to display documents.
OCP Java SE 11 - Coggle Diagram
OCP Java SE 11
Programmer II
Ch 1. Java Fundamentals p31
Introducing Functional Programming p53
Defining a Functional Interface p53
Declaring a Functional Interface with Object Methods p54
Implementing Functional Interfaces with Lambdas p56
Writing Lambda Expressions p58
Working with Lambda Variables p60
Parameter List p60
Restrictions on Using var in the Parameter List p60
Local Variables Inside the Lambda Body p61
Variables Referenced from the Lambda Body p61
Review Questions p63
Ch 2. Annotations p73
Introducing Annotations p73
Understanding Metadata p73
Purpose of Annotations p73
Creating Custom Annotations p76
Creating an Annotation p76
Specifying a Required Element p76
Providing an Optional Element p77
Selecting an Element Type p78
Applying Element Modifiers p79
Adding a Constant Variable p79
Reviewing Annotation Rules p79
Applying Annotations p80
Using Annotations in Declarations p80
Mixing Required and Optional Elements p81
Creating a value() Element p82
Passing an Array of Values p83
Declaring Annotation-Specific Annotations p84
Limiting Usage with
Target
p84
Storing Annotations with
Retention
p86
Generating Javadoc with
Documented
p87
Inheriting Annotations with
Inherited
p88
Reviewing Annotation specific Annotations p90
Using Common Annotations p91
Marking Methods with
Override
p91
Declaring Interfaces with
FunctionalInterface
p92
Retiring Code with
Depricated
p93
Ignoring Warnings with
SuppressWarning
p94
Protecting Arguments with
SafeVarargs
p95
Reviewing Common Annotations p96
Review Questions p96
Ch 3. Generics,Collections p106
Using Method References p106
Calling Static Methods p108
Calling Instance Methods on a Particular Object p108
Calling Instance Methods on a Parameter p108
Calling Constructors p109
Using Wrapper Classes p110
Using the Diamond Operator p111
Using Lists, Maps, and Queues p112
Common Collections Methods p113
add() p113
remove() p113
isEmpty() and size() p114
clear() p115
contains() p115
removeIf(Predicate) p115
forEach() p116
Using the List interface p116
Comparing List Implementations p117
Creating a List with a Factory p118
Working with List Methods p118
Using the Set Interface p120
Comparing Set Implementations p121
Working with Set Methods p122
Using the Queue Interface p123
Comparing Queue implementations p123
Working with Queue Methods p123
Using the Map Interface p125
Comparing Map Implementations p126
Working with Map Methods p126
Basic Methods p127
forEach() and entrySet() p128
getOrDefault() p128
replace() and replaceAll() p129
Comparing Collection Types p130
Sorting Data p131
Creating a Comparable class p131
Comparing with a Comparator p135
Sorting and Searching p138
Working with Generics p139
Generic Classes p140
Generic Interfaces p142
Generic Methods p143
Bounding Generic Types p144
Unbounded Wildcards p145
Upper-Bounded Wildcards p146
Lower-Bounded Wildcards p147
Review Questions p151
Ch 4. Functional Programming p160
Working with Built-in Functional Interfaces p160
Implementing Supplier p161
Implementing Consumer and BiConsumer p162
Implementing Predicate and BiPredicate p163
Implementing Function and BiFunction p164
Implementing UnaryOperator and BinaryOperator p165
Checking Functional Interfaces p166
Convenience Methods on Functional Interfaces p167
Returning an Optional p168
Creating an Optional p168
Dealing with an empty Optional p170
Using Streams p171
Understanding the Pipeline Flow p171
Creating Stream Sources p174
Creating Finite Streams p174
Creating Infinite Streams p174
Reviewing Stream Creation Methods p175
Using Common Terminal Operations p175
count() p176
min() and max() p176
findAny() and findFirst() p177
allMatch(), anyMatch(), and noneMatch() p177
forEach() p178
reduce() p179
collect() p180
Using Common Intermediate Operations p181
filter() p181
distinct() p182
limit() and skip() p182
map() p182
flatMap() p183
sorted() p183
peek() p184
Putting Together the Pipeline p185
Working with Primitive Streams p188
Creating Primitive Streams p189
Mapping Streams p191
Using Optional with Primitive Streams p193
Summarizing Statistics p193
Learning the Functional Interfaces for Primitives p194
Working with Advanced Stream Pipeline Concepts p196
Linking Streams to the Underlying Data p196
Chaining Optionals p196
Collecting Results p199
Collecting Using Basic Collectors p200
Collecting into Maps p201
Collecting using Grouping, Partitioning, and Mapping p202
Review Questions p206
Ch 5. Exceptions,Localization p215
Ch 6. Modular Apps p260
Reviewing Module Directoves p260
Comparing Types of Modules p260
Analyzing JDK Dependencies p269
Migrating an Application p272
Creating a Service p279
Review Questions p287
Ch 7. Concurrency p292
introducting Threads p292
Distinguishing Thread Types p293
Defining with Runnable p295
Creating a Thread p296
Creating Threads with the Concurrency API p299
Introducing SingleThreadExecutor p299
Shutting Down a Thread Executor p300
Submitting Tasks p301
Waiting for Results p302
Introducing Callable p303
Waiting for All Tasks to Finish p304
Submitting Task Collections p304
Scheduling Tasks p305
Increasing Concurrency with Pools p305
Writing Thread-Safe Code p309
Protecting Data with Atomic Classes p310
Improving Access with Synchronized Blocks p312
Synchronizing on Methods p314
Understanding the Lock Framework p314
Applying ReentrantLock p315
Attempting to acquire a Lock p316
tryLock() p316
tryLock(long, timeUnit) p317
Orchestrating Tasks with a CyclicBarrier p318
Using Concurrent Collections p320
Understanding Memory Consistency Errors p320
Working with Concurrent Classes p321
Understanding SkipList Collections p322
Understanding CopyOnWriteCollections p322
Understanding Blocking Queues p324
Obtaining Synchronized Collections p324
Indentifying Threading Problems p325
Understanding Liveness p325
Deadlock p326
Starvation p327
Livelock p327
Managing Race Conditions p328
Working with Parallel Streams p329
Creating Parallel Streams p329
Parallel Decomposition p330
Processing Parallel Reductions p331
Performing Order-Based Tasks p331
Combining Results with reduce() p332
Combining Results with collect() p334
Performing a Parallel Reduction on a Collector p334
Avoiding Stateful Operations p335
Review Questions p337
Ch 8. I/O p347
Understanding Files and Directories p347
Introducing I/O Streams p352
Common I/O Stream Operations p357
Working with I/O Stream Classes p362
Serializing Data p366
Printing Data p371
Interacting with Users p376
Review Questions p381
Ch 9. NIO.2 p389
Introducing NIO.2 p389
introducing Path p389
Creating Paths p390
Obtaining a Path with a Path interface p391
Obtaining a Path with the Paths class p392
Obtaining a Path with a URI Class p392
Obtaining a Path from the java.io.File class p394
Understanding Common NIO.2 Features p395
Interacting with Paths p397
Viewing the Path with toString(), getNameCount(), and getName() p398
Creating a New Path with subpath() p399
Accessing Path Elements with getFileName(), getParent(), and getRoot() p400
Checking Path Type with isAbsolute() and toAbsolutePath() p400
Joining Pats with resolve() p401
Deriving a Path with relativize() p402
Cleaning Up a Path with normalize() p403
Retrieving the File System Path with toRealPath() p403
Operating on Files and Directories p404
Checking for Existence with exists() p405
Managing Files Attributes p411
Applying Functional Programming p415
Comparing Legacy java.io.File and NIO.2 Methods
Review Questions p423
Ch 10. JDBC p431
Introducing Relational Databases and SQL p431
Writing Basic SQL Statements p434
Identifying the Structure of a Relational Database p432
Introducing the Interfaces of JDBC p435
Connecting to a Database p437
Building a JDBC URL p437
Getting a Database Connection p438
Working with a PreparedStatement p440
Obtaining a Prepared Statement p441
Executing a PreparedStatement p442
Modifying Data with executeUpdate() p442
Reading Data with executeQuery() p442
Processing Data with execute() p443
Reviewing PreparedStatement methods p443
Working with Parameters p444
Updating Multiple Times p446
Getting Data from a ResultSet p447
Reading a ResultSet p447
Getting Data for a Column p450
Using Bind Variables p451
Calling a CallableStatement p452
Calling a Procedure without Parameters p452
Passing an IN Parameter p453
Returning an OUT Parameter p453
Working with an INOUT Parameter p454
Closing Database Resources p454
Review Questions p457
Ch 11. Security p464
Designing a Secure Object p464
Limiting Accessibility p464
Restricting Extensibility p465
Creating Immutable Objects p465
Cloning Objects p467
Introducing Injection and Input Validation p470
Preventing Injection with a PreparedStatement p470
Using Statement p471
Using PreparedStatement p471
Invalidating Invalid Input with Validation p472
Working with Confidential Information p475
Guarding Sensitive Data from Output p476
Protecting Data in Memory p476
Limiting File Access p477
Serializing and Deserializing Objects p477
Specifying Which Fields to Serialize p478
Customizing the Serialization Process p478
Pre/Post-Serializatin Processing p479
Applying readResolve() p480
Applying writeReplace() p480
Constructing Sensitive Objects p482
Preventing Denial of Service Attacks p484
Leaking Resources p484
Reading Very Large Resources p485
Including Poetntially Large Resources p485
Review Questions p487
Appendix B. Answers to Review Questions
Ch 1. Java Funcamentals p532
Ch 2. Annotations p535
Ch 3: Generics and Collections p537
Ch 4. Functional Programming p539
Ch 7. Concurrency p545
Ch 8: I/O p548
Ch 9: NIO.2 p550
Ch 10: JDBC p553
Ch 11: Security p554
Ch 6. Modular Applications p544
Ch 5. p542
Appendix A. The Upgrade Exam p493
Programmer I
Ch11 Modules p507