Introduction |
|
xxix | |
Assessment Tests |
|
lix | |
|
Part I Exam 1Z0-815, OCP Java SE 11 Programmer I |
|
|
1 | (492) |
|
Chapter 1 Welcome To Java |
|
|
3 | (34) |
|
Learning About the Java Environment |
|
|
4 | (2) |
|
|
4 | (1) |
|
|
5 | (1) |
|
Identifying Benefits of Java |
|
|
6 | (1) |
|
Understanding the Java Class Structure |
|
|
7 | (3) |
|
|
7 | (1) |
|
|
8 | (2) |
|
|
10 | (1) |
|
|
10 | (5) |
|
|
11 | (1) |
|
Passing Parameters to a Java Program |
|
|
12 | (2) |
|
Running a Program in One Line |
|
|
14 | (1) |
|
Understanding Package Declarations and Imports |
|
|
15 | (11) |
|
|
17 | (1) |
|
|
17 | (1) |
|
|
18 | (2) |
|
|
20 | (1) |
|
Compiling and Running Code with Packages |
|
|
21 | (1) |
|
Using an Alternate Directory |
|
|
22 | (2) |
|
|
24 | (1) |
|
|
25 | (1) |
|
Running a Program in One Line with Packages |
|
|
26 | (1) |
|
Ordering Elements in a Class |
|
|
26 | (2) |
|
Code Formatting on the Exam |
|
|
28 | (1) |
|
|
29 | (1) |
|
|
29 | (2) |
|
|
31 | (6) |
|
Chapter 2 Java Building Blocks |
|
|
37 | (44) |
|
|
38 | (4) |
|
|
38 | (1) |
|
Reading and Writing Member Fields |
|
|
39 | (1) |
|
Executing Instance Initializer Blocks |
|
|
40 | (1) |
|
Following Order of Initialization |
|
|
41 | (1) |
|
|
42 | (6) |
|
|
42 | (4) |
|
|
46 | (1) |
|
Distinguishing between Primitives and Reference Types |
|
|
47 | (1) |
|
|
48 | (4) |
|
|
48 | (3) |
|
Declaring Multiple Variables |
|
|
51 | (1) |
|
|
52 | (9) |
|
|
53 | (1) |
|
Passing Constructor and Method Parameters |
|
|
54 | (1) |
|
Defining Instance and Class Variables |
|
|
55 | (1) |
|
|
55 | (6) |
|
|
61 | (3) |
|
|
61 | (1) |
|
|
62 | (1) |
|
|
62 | (1) |
|
Applying Scope to Classes |
|
|
63 | (1) |
|
|
64 | (1) |
|
|
64 | (5) |
|
Understanding Garbage Collection |
|
|
65 | (1) |
|
|
66 | (3) |
|
|
69 | (1) |
|
|
69 | (2) |
|
|
71 | (10) |
|
|
81 | (34) |
|
Understanding Java Operators |
|
|
82 | (2) |
|
|
82 | (1) |
|
|
83 | (1) |
|
|
84 | (3) |
|
Logical Complement and Negation Operators |
|
|
85 | (1) |
|
Increment and Decrement Operators |
|
|
86 | (1) |
|
Working with Binary Arithmetic Operators |
|
|
87 | (5) |
|
|
88 | (2) |
|
|
90 | (2) |
|
|
92 | (5) |
|
|
92 | (1) |
|
|
92 | (3) |
|
Compound Assignment Operators |
|
|
95 | (1) |
|
Assignment Operator Return Value |
|
|
96 | (1) |
|
|
97 | (7) |
|
|
97 | (2) |
|
|
99 | (2) |
|
|
101 | (1) |
|
|
102 | (2) |
|
Making Decisions with the Ternary Operator |
|
|
104 | (1) |
|
|
105 | (1) |
|
|
106 | (1) |
|
|
107 | (8) |
|
Chapter 4 Making Decisions |
|
|
115 | (48) |
|
Creating Decision-Making Statements |
|
|
116 | (12) |
|
|
116 | (1) |
|
|
117 | (1) |
|
|
118 | (3) |
|
|
121 | (7) |
|
|
128 | (4) |
|
|
128 | (1) |
|
|
129 | (1) |
|
Comparing while and do/while Loops |
|
|
130 | (1) |
|
|
131 | (1) |
|
|
132 | (11) |
|
|
133 | (5) |
|
|
138 | (5) |
|
Controlling Flow with Branching |
|
|
143 | (8) |
|
|
143 | (1) |
|
|
144 | (1) |
|
|
145 | (2) |
|
|
147 | (2) |
|
|
149 | (1) |
|
|
150 | (1) |
|
|
150 | (1) |
|
|
151 | (1) |
|
|
152 | (1) |
|
|
153 | (10) |
|
|
163 | (60) |
|
Creating and Manipulating Strings |
|
|
164 | (10) |
|
|
165 | (1) |
|
|
166 | (1) |
|
|
167 | (6) |
|
|
173 | (1) |
|
Using the StringBuilder Class |
|
|
174 | (5) |
|
|
175 | (1) |
|
|
176 | (1) |
|
Important StringBuilder Methods |
|
|
176 | (3) |
|
|
179 | (3) |
|
Comparing equais() and == |
|
|
179 | (2) |
|
|
181 | (1) |
|
Understanding Java Arrays |
|
|
182 | (13) |
|
Creating an Array of Primitives |
|
|
183 | (2) |
|
Creating an Array with Reference Variables |
|
|
185 | (2) |
|
|
187 | (1) |
|
|
188 | (1) |
|
|
189 | (1) |
|
|
190 | (2) |
|
|
192 | (1) |
|
|
192 | (3) |
|
Understanding an ArrayList |
|
|
195 | (11) |
|
|
195 | (2) |
|
|
197 | (4) |
|
|
201 | (2) |
|
|
203 | (1) |
|
Converting Between array and List |
|
|
203 | (2) |
|
Using Varargs to Create a List |
|
|
205 | (1) |
|
|
206 | (1) |
|
|
206 | (2) |
|
|
206 | (1) |
|
|
207 | (1) |
|
Calculating with Math APIs |
|
|
208 | (2) |
|
|
208 | (1) |
|
|
209 | (1) |
|
|
209 | (1) |
|
|
210 | (1) |
|
|
210 | (1) |
|
|
211 | (1) |
|
|
212 | (11) |
|
Chapter 6 Lembdas And Functional Interfaces |
|
|
223 | (26) |
|
|
224 | (5) |
|
|
224 | (3) |
|
|
227 | (2) |
|
Introducing Functional Interfaces |
|
|
229 | (4) |
|
|
230 | (1) |
|
|
230 | (1) |
|
|
231 | (1) |
|
|
232 | (1) |
|
Working with Variables in Lambdas |
|
|
233 | (3) |
|
|
233 | (1) |
|
Local Variables inside the Lambda Body |
|
|
233 | (1) |
|
Variables Referenced from the Lambda Body |
|
|
234 | (2) |
|
Calling APIs with Lambdas |
|
|
236 | (2) |
|
|
236 | (1) |
|
|
237 | (1) |
|
|
237 | (1) |
|
|
238 | (1) |
|
|
239 | (1) |
|
|
240 | (9) |
|
Chapter 7 Methods And Encapsulation |
|
|
249 | (48) |
|
|
250 | (6) |
|
|
251 | (1) |
|
|
252 | (1) |
|
|
253 | (1) |
|
|
254 | (1) |
|
|
255 | (1) |
|
|
255 | (1) |
|
|
256 | (1) |
|
|
256 | (2) |
|
Applying Access Modifiers |
|
|
258 | (8) |
|
|
258 | (1) |
|
Default (Package-Private) Access |
|
|
259 | (2) |
|
|
261 | (4) |
|
|
265 | (1) |
|
Applying the static Keyword |
|
|
266 | (8) |
|
Designing static Methods and Fields |
|
|
266 | (1) |
|
Accessing a static Variable or Method |
|
|
267 | (1) |
|
|
268 | (2) |
|
|
270 | (1) |
|
|
271 | (1) |
|
|
272 | (2) |
|
Passing Data among Methods |
|
|
274 | (3) |
|
|
277 | (6) |
|
|
279 | (1) |
|
|
279 | (1) |
|
|
279 | (2) |
|
|
281 | (1) |
|
|
281 | (1) |
|
|
282 | (1) |
|
|
282 | (1) |
|
|
283 | (2) |
|
|
285 | (1) |
|
|
286 | (1) |
|
|
287 | (10) |
|
|
297 | (68) |
|
Understanding Inheritance |
|
|
298 | (3) |
|
Single vs. Multiple Inheritance |
|
|
299 | (1) |
|
|
300 | (1) |
|
|
301 | (6) |
|
|
301 | (2) |
|
Applying Class Access Modifiers |
|
|
303 | (1) |
|
Accessing the this Reference |
|
|
304 | (1) |
|
Calling the super Reference |
|
|
305 | (2) |
|
|
307 | (18) |
|
|
307 | (1) |
|
|
308 | (2) |
|
Calling Overloaded Constructors with this() |
|
|
310 | (2) |
|
Calling Parent Constructors with super() |
|
|
312 | (4) |
|
Constructors and final Fields |
|
|
316 | (2) |
|
|
318 | (6) |
|
Reviewing Constructor Rules |
|
|
324 | (1) |
|
|
325 | (14) |
|
Calling Inherited Members |
|
|
325 | (1) |
|
|
326 | (12) |
|
|
338 | (1) |
|
Understanding Polymorphism |
|
|
339 | (9) |
|
|
341 | (1) |
|
|
342 | (1) |
|
|
343 | (1) |
|
Polymorphism and Method Overriding |
|
|
344 | (2) |
|
Overriding vs. Hiding Members |
|
|
346 | (2) |
|
|
348 | (1) |
|
|
349 | (2) |
|
|
351 | (14) |
|
Chapter 9 Advanced Class Design |
|
|
365 | (38) |
|
Creating Abstract Classes |
|
|
366 | (9) |
|
Introducing Abstract Classes |
|
|
366 | (2) |
|
Defining Abstract Methods |
|
|
368 | (4) |
|
Creating a Concrete Class |
|
|
372 | (2) |
|
Reviewing Abstract Class Rules |
|
|
374 | (1) |
|
|
375 | (15) |
|
|
375 | (4) |
|
Inserting Implicit Modifiers |
|
|
379 | (3) |
|
|
382 | (4) |
|
Polymorphism and Interfaces |
|
|
386 | (2) |
|
Reviewing Interface Rules |
|
|
388 | (2) |
|
Introducing Inner Classes |
|
|
390 | (2) |
|
Defining a Member Inner Class |
|
|
390 | (1) |
|
Using a Member Inner Class |
|
|
391 | (1) |
|
|
392 | (1) |
|
|
393 | (1) |
|
|
394 | (9) |
|
|
403 | (50) |
|
|
404 | (7) |
|
|
404 | (2) |
|
Understanding Exception Types |
|
|
406 | (3) |
|
|
409 | (2) |
|
Recognizing Exception Classes |
|
|
411 | (5) |
|
|
411 | (3) |
|
Checked Exception Classes |
|
|
414 | (1) |
|
|
415 | (1) |
|
|
416 | (18) |
|
Using try and catch Statements |
|
|
416 | (2) |
|
|
418 | (2) |
|
Applying a Multi-catch Block |
|
|
420 | (3) |
|
|
423 | (3) |
|
Finally Closing Resources |
|
|
426 | (6) |
|
Throwing Additional Exceptions |
|
|
432 | (2) |
|
Calling Methods That Throw Exceptions |
|
|
434 | (5) |
|
Declaring and Overriding Methods with Exceptions |
|
|
436 | (1) |
|
|
437 | (2) |
|
|
439 | (1) |
|
|
440 | (2) |
|
|
442 | (11) |
|
|
453 | (40) |
|
|
454 | (4) |
|
|
455 | (1) |
|
|
456 | (2) |
|
Creating and Running a Modular Program |
|
|
458 | (7) |
|
|
459 | (1) |
|
Compiling Our First Module |
|
|
460 | (2) |
|
|
462 | (1) |
|
Packaging Our First Module |
|
|
463 | (2) |
|
Updating Our Example for Multiple Modules |
|
|
465 | (7) |
|
Updating the Feeding Module |
|
|
465 | (1) |
|
|
466 | (2) |
|
Creating the Talks Module |
|
|
468 | (3) |
|
Creating the Staff Module |
|
|
471 | (1) |
|
Diving into the module-info File |
|
|
472 | (5) |
|
|
472 | (2) |
|
|
474 | (2) |
|
provides, uses, and opens |
|
|
476 | (1) |
|
|
477 | (6) |
|
|
477 | (3) |
|
|
480 | (1) |
|
|
480 | (2) |
|
|
482 | (1) |
|
Reviewing Command-Line Options |
|
|
483 | (2) |
|
|
485 | (1) |
|
|
486 | (1) |
|
|
487 | (6) |
|
Part II Exam 1Z0-816, OCP Java SE 11 Programmer II Exam 1Z0-817, Upgrade OCP Java SE 11 |
|
|
493 | (612) |
|
Chapter 12 Java Fundamentals |
|
|
495 | (58) |
|
Applying the final Modifier |
|
|
496 | (4) |
|
Declaring final Local Variables |
|
|
496 | (1) |
|
Adding final to Instance and static Variables |
|
|
497 | (1) |
|
|
498 | (1) |
|
|
499 | (1) |
|
|
500 | (6) |
|
|
500 | (2) |
|
Using Enums in Switch Statements |
|
|
502 | (1) |
|
Adding Constructors, Fields, and Methods |
|
|
503 | (3) |
|
|
506 | (10) |
|
|
506 | (3) |
|
Creating a static Nested Class |
|
|
509 | (2) |
|
|
511 | (1) |
|
Defining an Anonymous Class |
|
|
512 | (3) |
|
|
515 | (1) |
|
Understanding Interface Members |
|
|
516 | (10) |
|
Relying on a default Interface Method |
|
|
517 | (4) |
|
Using static Interface Methods |
|
|
521 | (1) |
|
Introducing private Interface Methods |
|
|
522 | (1) |
|
Introducing private static Interface Methods |
|
|
523 | (2) |
|
Reviewing Interface Members |
|
|
525 | (1) |
|
Introducing Functional Programming |
|
|
526 | (11) |
|
Defining a Functional Interface |
|
|
526 | (2) |
|
Declaring a Functional Interface with Object Methods |
|
|
528 | (2) |
|
Implementing Functional Interfaces with Lambdas |
|
|
530 | (2) |
|
Writing Lambda Expressions |
|
|
532 | (2) |
|
Working with Lambda Variables |
|
|
534 | (3) |
|
|
537 | (1) |
|
|
538 | (2) |
|
|
540 | (13) |
|
|
553 | (46) |
|
|
554 | (4) |
|
|
554 | (1) |
|
|
555 | (3) |
|
Creating Custom Annotations |
|
|
558 | (5) |
|
|
558 | (1) |
|
Specifying a Required Element |
|
|
559 | (1) |
|
Providing an Optional Element |
|
|
560 | (1) |
|
Selecting an Element Type |
|
|
561 | (1) |
|
Applying Element Modifiers |
|
|
561 | (1) |
|
Adding a Constant Variable |
|
|
562 | (1) |
|
Reviewing Annotation Rules |
|
|
562 | (1) |
|
|
563 | (5) |
|
Using Annotations in Declarations |
|
|
563 | (2) |
|
Mixing Required and Optional Elements |
|
|
565 | (1) |
|
Creating a value() Element |
|
|
565 | (2) |
|
Passing an Array of Values |
|
|
567 | (1) |
|
Declaring Annotation-Specific Annotations |
|
|
568 | (9) |
|
Limiting Usage with @Target |
|
|
568 | (3) |
|
Storing Annotations with @Retention |
|
|
571 | (1) |
|
Generating javadoc with @Documented |
|
|
572 | (1) |
|
Inheriting Annotations with @Inherited |
|
|
573 | (1) |
|
Supporting Duplicates with @Repeatable |
|
|
573 | (2) |
|
Reviewing An notation-Specific Annotations |
|
|
575 | (2) |
|
|
577 | (8) |
|
Marking Methods with @Override |
|
|
577 | (1) |
|
Declaring Interfaces with @FunctionalInterface |
|
|
578 | (1) |
|
Retiring Code with @Deprecated |
|
|
579 | (1) |
|
Ignoring Warnings with @SuppressWarnings |
|
|
580 | (2) |
|
Protecting Arguments with @SafeVarargs |
|
|
582 | (1) |
|
Reviewing Common Annotations |
|
|
583 | (2) |
|
|
585 | (1) |
|
|
586 | (2) |
|
|
588 | (11) |
|
Chapter 14 Generics And Collections |
|
|
599 | (70) |
|
|
601 | (4) |
|
|
602 | (1) |
|
Calling Instance Methods on a Particular Object |
|
|
603 | (1) |
|
Calling Instance Methods on a Parameter |
|
|
603 | (1) |
|
|
604 | (1) |
|
Reviewing Method References |
|
|
604 | (1) |
|
|
605 | (2) |
|
Using the Diamond Operator |
|
|
607 | (1) |
|
Using Lists, Sets, Maps, and Queues |
|
|
608 | (23) |
|
Common Collections Methods |
|
|
609 | (4) |
|
|
613 | (5) |
|
|
618 | (2) |
|
Using the Queue Interface |
|
|
620 | (2) |
|
|
622 | (7) |
|
Comparing Collection Types |
|
|
629 | (2) |
|
|
631 | (10) |
|
Creating a Comparable Class |
|
|
631 | (4) |
|
Comparing Data with a Comparator |
|
|
635 | (1) |
|
Comparing Comparable and Comparator |
|
|
636 | (1) |
|
Comparing Multiple Fields |
|
|
637 | (2) |
|
|
639 | (2) |
|
|
641 | (14) |
|
|
642 | (3) |
|
|
645 | (1) |
|
|
646 | (1) |
|
|
647 | (1) |
|
|
648 | (5) |
|
|
653 | (2) |
|
|
655 | (2) |
|
|
657 | (1) |
|
|
658 | (11) |
|
Chapter 15 Functional Programming |
|
|
669 | (72) |
|
Working with Built-in Functional Interfaces |
|
|
670 | (11) |
|
|
672 | (1) |
|
Implementing Consumer and BiConsumer |
|
|
673 | (1) |
|
Implementing Predicate and BiPredicate |
|
|
674 | (1) |
|
Implementing Function and BiFunction |
|
|
675 | (2) |
|
Implementing UnaryOperator and BinaryOperator |
|
|
677 | (1) |
|
Checking Functional Interfaces |
|
|
678 | (1) |
|
Convenience Methods on Functional Interfaces |
|
|
679 | (2) |
|
|
681 | (4) |
|
|
682 | (1) |
|
Dealing with an Empty Optional |
|
|
683 | (2) |
|
|
685 | (22) |
|
Understanding the Pipeline Flow |
|
|
685 | (3) |
|
|
688 | (3) |
|
Using Common Terminal Operations |
|
|
691 | (7) |
|
Using Common Intermediate Operations |
|
|
698 | (5) |
|
Putting Together the Pipeline |
|
|
703 | (4) |
|
Working with Primitive Streams |
|
|
707 | (11) |
|
Creating Primitive Streams |
|
|
708 | (3) |
|
|
711 | (2) |
|
Using Optional with Primitive Streams |
|
|
713 | (1) |
|
|
714 | (1) |
|
Learning the Functional Interfaces for Primitives |
|
|
715 | (3) |
|
Working with Advanced Stream Pipeline Concepts |
|
|
718 | (10) |
|
Linking Streams to the Underlying Data |
|
|
718 | (1) |
|
|
718 | (3) |
|
|
721 | (7) |
|
|
728 | (2) |
|
|
730 | (2) |
|
|
732 | (9) |
|
Chapter 16 Exceptions, Assertions, And Localization |
|
|
741 | (62) |
|
|
742 | (5) |
|
|
742 | (2) |
|
Distinguishing between throw and throws |
|
|
744 | (1) |
|
Examining Exception Categories |
|
|
744 | (2) |
|
Inheriting Exception Classes |
|
|
746 | (1) |
|
Creating Custom Exceptions |
|
|
747 | (3) |
|
Declaring Exception Classes |
|
|
747 | (1) |
|
Adding Custom Constructors |
|
|
747 | (2) |
|
|
749 | (1) |
|
Automating Resource Management |
|
|
750 | (8) |
|
Constructing Try-With-Resources Statements |
|
|
750 | (3) |
|
Learning the New Effectively Final Feature |
|
|
753 | (2) |
|
Understanding Suppressed Exceptions |
|
|
755 | (3) |
|
|
758 | (4) |
|
Validating Data with the assert Statement |
|
|
758 | (2) |
|
|
760 | (1) |
|
|
761 | (1) |
|
|
761 | (1) |
|
Writing Assertions Correctly |
|
|
762 | (1) |
|
Working with Dates and Times |
|
|
762 | (8) |
|
|
763 | (2) |
|
Formatting Dates and Times |
|
|
765 | (5) |
|
Supporting Internationalization and Localization |
|
|
770 | (9) |
|
|
770 | (3) |
|
|
773 | (4) |
|
|
777 | (1) |
|
Specifying a Locale Category |
|
|
778 | (1) |
|
Loading Properties with Resource Bundles |
|
|
779 | (8) |
|
Creating a Resource Bundle |
|
|
780 | (2) |
|
Picking a Resource Bundle |
|
|
782 | (1) |
|
Selecting Resource Bundle Values |
|
|
783 | (2) |
|
|
785 | (1) |
|
Using the Properties Class |
|
|
786 | (1) |
|
|
787 | (1) |
|
|
788 | (1) |
|
|
789 | (14) |
|
Chapter 17 Modular Applications |
|
|
803 | (36) |
|
Reviewing Module Directives |
|
|
804 | (1) |
|
Comparing Types of Modules |
|
|
805 | (5) |
|
|
805 | (1) |
|
|
806 | (3) |
|
|
809 | (1) |
|
|
809 | (1) |
|
Analyzing JDK Dependencies |
|
|
810 | (5) |
|
Identifying Built-in Modules |
|
|
810 | (2) |
|
|
812 | (3) |
|
|
815 | (7) |
|
|
815 | (1) |
|
Exploring a Bottom-Up Migration Strategy |
|
|
816 | (2) |
|
Exploring a Top-Down Migration Strategy |
|
|
818 | (1) |
|
Splitting a Big Project into Modules |
|
|
819 | (1) |
|
Failing to Compile with a Cyclic Dependency |
|
|
820 | (2) |
|
|
822 | (9) |
|
Declaring the Service Provider Interface |
|
|
823 | (1) |
|
Creating a Service Locator |
|
|
824 | (2) |
|
|
826 | (1) |
|
Adding a Service Provider |
|
|
827 | (1) |
|
Merging Service Locator and Consumer |
|
|
828 | (3) |
|
|
831 | (1) |
|
|
831 | (1) |
|
|
832 | (1) |
|
|
833 | (6) |
|
|
839 | (74) |
|
|
841 | (8) |
|
Distinguishing Thread Types |
|
|
842 | (1) |
|
Understanding Thread Concurrency |
|
|
842 | (1) |
|
Defining a Task with Runnable |
|
|
843 | (2) |
|
|
845 | (2) |
|
|
847 | (2) |
|
Creating Threads with the Concurrency API |
|
|
849 | (12) |
|
Introducing the Single-Thread Executor |
|
|
849 | (1) |
|
Shutting Down a Thread Executor |
|
|
850 | (1) |
|
|
851 | (1) |
|
|
852 | (4) |
|
Submitting Task Collections |
|
|
856 | (1) |
|
|
857 | (3) |
|
Increasing Concurrency with Pools |
|
|
860 | (1) |
|
|
861 | (15) |
|
Understanding Thread-Safety |
|
|
861 | (2) |
|
Protecting Data with Atomic Classes |
|
|
863 | (2) |
|
Improving Access with Synchronized Blocks |
|
|
865 | (2) |
|
|
867 | (2) |
|
Understanding the Lock Framework |
|
|
869 | (4) |
|
Orchestrating Tasks with a CyclicBarrier |
|
|
873 | (3) |
|
Using Concurrent Collections |
|
|
876 | (7) |
|
Understanding Memory Consistency Errors |
|
|
877 | (1) |
|
Working with Concurrent Classes |
|
|
877 | (5) |
|
Obtaining Synchronized Collections |
|
|
882 | (1) |
|
Identifying Threading Problems |
|
|
883 | (5) |
|
|
884 | (3) |
|
|
887 | (1) |
|
Working with Parallel Streams |
|
|
888 | (10) |
|
Creating Parallel Streams |
|
|
889 | (1) |
|
Performing a Parallel Decomposition |
|
|
890 | (2) |
|
Processing Parallel Reductions |
|
|
892 | (5) |
|
Avoiding Stateful Operations |
|
|
897 | (1) |
|
|
898 | (1) |
|
|
899 | (1) |
|
|
900 | (13) |
|
|
913 | (56) |
|
Understanding Files and Directories |
|
|
914 | (6) |
|
Conceptualizing the File System |
|
|
914 | (2) |
|
|
916 | (1) |
|
Introducing the File Class |
|
|
916 | (4) |
|
|
920 | (7) |
|
Understanding I/O Stream Fundamentals |
|
|
920 | (1) |
|
Learning I/O Stream Nomenclature |
|
|
921 | (6) |
|
Common I/O Stream Operations |
|
|
927 | (7) |
|
|
927 | (2) |
|
|
929 | (1) |
|
Manipulating Input Streams |
|
|
930 | (2) |
|
|
932 | (1) |
|
Reviewing Common I/O Stream Methods |
|
|
933 | (1) |
|
Working with I/O Stream Classes |
|
|
934 | (18) |
|
Reading and Writing Binary Data |
|
|
934 | (1) |
|
|
935 | (2) |
|
Reading and Writing Character Data |
|
|
937 | (1) |
|
|
938 | (1) |
|
|
939 | (7) |
|
|
946 | (5) |
|
|
951 | (1) |
|
|
952 | (6) |
|
Printing Data to the User |
|
|
953 | (1) |
|
Reading Input as a Stream |
|
|
954 | (1) |
|
|
954 | (1) |
|
Acquiring Input with Console |
|
|
955 | (3) |
|
|
958 | (1) |
|
|
958 | (2) |
|
|
960 | (9) |
|
|
969 | (54) |
|
|
970 | (10) |
|
|
971 | (1) |
|
|
972 | (5) |
|
Understanding Common Nio.2 Features |
|
|
977 | (3) |
|
|
980 | (9) |
|
Viewing the Path with toString(), getNameCount(), and getHame() |
|
|
980 | (1) |
|
Creating a New Path with subpath() |
|
|
981 | (1) |
|
Accessing Path Elements with getFileName(), getParent(), and getRoot() |
|
|
982 | (2) |
|
Checking Path Type with isAbsolute() and toAbsolutePath() |
|
|
984 | (1) |
|
Joining Paths with resolve() |
|
|
985 | (1) |
|
Deriving a Path with relativized |
|
|
985 | (2) |
|
Cleaning Up a Path with normalized |
|
|
987 | (1) |
|
Retrieving the File System Path with toRealPath() |
|
|
987 | (1) |
|
|
988 | (1) |
|
Operating on Files and Directories |
|
|
989 | (8) |
|
Checking for Existence with exists() |
|
|
989 | (1) |
|
Testing Uniqueness with isSameFile() |
|
|
990 | (1) |
|
Making Directories with createDirectory() and createDirectories() |
|
|
991 | (1) |
|
Copying Files with copy() |
|
|
992 | (2) |
|
Moving or Renaming Paths with move() |
|
|
994 | (1) |
|
Deleting a File with delete() and deleteIfExists() |
|
|
994 | (1) |
|
Reading and Writing Data with newBufferedReader() and newBufferedWriter() |
|
|
995 | (1) |
|
Reading a File with readAllLines() |
|
|
996 | (1) |
|
|
996 | (1) |
|
|
997 | (5) |
|
Discovering File Attributes |
|
|
997 | (3) |
|
Improving Attribute Access |
|
|
1000 | (2) |
|
Applying Functional Programming |
|
|
1002 | (9) |
|
Listing Directory Contents |
|
|
1002 | (2) |
|
Traversing a Directory Tree |
|
|
1004 | (4) |
|
Searching a Directory with find() |
|
|
1008 | (1) |
|
Reading a File with Unes() |
|
|
1009 | (2) |
|
Comparing Legacy java.io.File and Nio.2 Methods |
|
|
1011 | (1) |
|
|
1012 | (1) |
|
|
1012 | (2) |
|
|
1014 | (9) |
|
|
1023 | (46) |
|
Introducing Relational Databases and SQL |
|
|
1024 | (5) |
|
Identifying the Structure of a Relational Database |
|
|
1026 | (1) |
|
Writing Basic SQL Statements |
|
|
1027 | (2) |
|
Introducing the Interfaces of JDBC |
|
|
1029 | (2) |
|
|
1031 | (5) |
|
|
1031 | (2) |
|
Getting a Database Connection |
|
|
1033 | (3) |
|
Working with a PreparedStatement |
|
|
1036 | (9) |
|
Obtaining a PreparedStatement |
|
|
1037 | (1) |
|
Executing a PreparedStatement |
|
|
1037 | (3) |
|
|
1040 | (3) |
|
|
1043 | (2) |
|
Getting Data from a ResultSet |
|
|
1045 | (6) |
|
|
1045 | (4) |
|
Getting Data for a Column |
|
|
1049 | (1) |
|
|
1050 | (1) |
|
Calling a CallableStatement |
|
|
1051 | (4) |
|
Calling a Procedure without Parameters |
|
|
1052 | (1) |
|
|
1053 | (1) |
|
Returning an OUT Parameter |
|
|
1053 | (1) |
|
Working with an INOUT Parameter |
|
|
1054 | (1) |
|
Comparing Callable Statement Parameters |
|
|
1054 | (1) |
|
Closing Database Resources |
|
|
1055 | (3) |
|
|
1058 | (1) |
|
|
1058 | (2) |
|
|
1060 | (9) |
|
|
1069 | (36) |
|
Designing a Secure Object |
|
|
1070 | (7) |
|
|
1070 | (1) |
|
Restricting Extensibility |
|
|
1071 | (1) |
|
Creating Immutable Objects |
|
|
1072 | (3) |
|
|
1075 | (2) |
|
Introducing Injection and Input Validation |
|
|
1077 | (5) |
|
Preventing Injection with a PreparedStatement |
|
|
1077 | (3) |
|
Invalidating Invalid Input with Validation |
|
|
1080 | (2) |
|
Working with Confidential Information |
|
|
1082 | (3) |
|
Guarding Sensitive Data from Output |
|
|
1083 | (1) |
|
Protecting Data in Memory |
|
|
1083 | (1) |
|
|
1084 | (1) |
|
Serializing and Deserializing Objects |
|
|
1085 | (6) |
|
Specifying Which Fields to Serialize |
|
|
1085 | (1) |
|
Customizing the Serialization Process |
|
|
1086 | (1) |
|
Pre/Post-Serialization Processing |
|
|
1087 | (3) |
|
Reviewing Serialization Methods |
|
|
1090 | (1) |
|
Constructing Sensitive Objects |
|
|
1091 | (3) |
|
|
1092 | (1) |
|
|
1092 | (1) |
|
Making the Constructor private |
|
|
1093 | (1) |
|
Preventing Denial of Service Attacks |
|
|
1094 | (3) |
|
|
1094 | (1) |
|
Reading Very Large Resources |
|
|
1094 | (1) |
|
Including Potentially Large Resources |
|
|
1095 | (1) |
|
|
1095 | (1) |
|
|
1096 | (1) |
|
|
1097 | (1) |
|
|
1098 | (1) |
|
|
1099 | (6) |
|
Appendix Answers to Review Questions |
|
|
1105 | (72) |
|
Chapter 1 Welcome to Java |
|
|
1106 | (2) |
|
Chapter 2 Java Building Blocks |
|
|
1108 | (4) |
|
|
1112 | (3) |
|
Chapter 4 Making Decisions |
|
|
1115 | (4) |
|
|
1119 | (4) |
|
Chapter 6 Lambdas and Functional Interfaces |
|
|
1123 | (2) |
|
Chapter 7 Methods and Encapsulation |
|
|
1125 | (2) |
|
|
1127 | (5) |
|
Chapter 9 Advanced Class Design |
|
|
1132 | (4) |
|
|
1136 | (4) |
|
|
1140 | (2) |
|
Chapter 12 Java Fundamentals |
|
|
1142 | (4) |
|
|
1146 | (3) |
|
Chapter 14 Generics and Collections |
|
|
1149 | (4) |
|
Chapter 15 Functional Programming |
|
|
1153 | (3) |
|
Chapter 16 Exceptions, Assertions, and Localization |
|
|
1156 | (4) |
|
Chapter 17 Modular Applications |
|
|
1160 | (2) |
|
|
1162 | (4) |
|
|
1166 | (3) |
|
|
1169 | (4) |
|
|
1173 | (2) |
|
|
1175 | (2) |
Index |
|
1177 | |