About the Authors |
|
xv | |
About the Technical Reviewer |
|
xvii | |
Acknowledgments |
|
xix | |
Introduction |
|
xxi | |
|
Chapter 1 The OCPJP 8 Exam: FAQ |
|
|
1 | (8) |
|
|
1 | (2) |
|
FAQ 1 Can you provide details of the Java associate and professional exams for Java 8? |
|
|
1 | (1) |
|
FAQ 2 Can you compare the specifications of the exams targeting OCAJP 8 and OCPJP 8 certifications? |
|
|
2 | (1) |
|
|
3 | (3) |
|
FAQ 3 OCAJP 8 certification is a prerequisite for OCPJP 8 certification. Does that mean that I have to take the OCAJP8 exam before I can take the OCPJP8 exam? |
|
|
3 | (1) |
|
FAQ 4 How does the OCPJP 8 exam differ from the older OCPJP 7 exam? |
|
|
3 | (1) |
|
FAQ 5 Should I take the OCPJP8 exam or earlier versions such as the OCPJP 7 exam? |
|
|
3 | (1) |
|
FAQ 6 What kinds of questions are asked in the OCPJP 8exam? |
|
|
3 | (1) |
|
FAQ 7 What does the OCPJP 8 exam test for? |
|
|
4 | (1) |
|
FAQ 8 I've been a Java programmer for the last five years. Do I have to prepare for the OCPJP 8 exam? |
|
|
5 | (1) |
|
FAQ 9 How do I prepare for the OCPJP 8 exam? |
|
|
5 | (1) |
|
FAQ 10 How do I know when I'm ready to take the OCPJP 8 exam? |
|
|
6 | (1) |
|
|
6 | (3) |
|
FAQ 11 What are my options to register for the exam? |
|
|
6 | (1) |
|
FAQ 12 How do I register for the exam, schedule a day and time for taking the exam, and appear for the exam? |
|
|
6 | (1) |
|
FAQ 13 What are the key things I need to remember before taking the exam and on the day of exam? |
|
|
7 | (2) |
|
Chapter 2 Java Class Design |
|
|
9 | (46) |
|
|
9 | (3) |
|
|
12 | (2) |
|
|
14 | (8) |
|
|
15 | (1) |
|
|
16 | (2) |
|
|
18 | (1) |
|
|
19 | (2) |
|
|
21 | (1) |
|
Overriding Methods in Object Class |
|
|
22 | (15) |
|
Overriding toString() Method |
|
|
23 | (3) |
|
Overriding equals() Method |
|
|
26 | (7) |
|
|
33 | (1) |
|
Composition vs. Inheritance |
|
|
34 | (3) |
|
Singleton and Immutable Classes |
|
|
37 | (6) |
|
|
37 | (3) |
|
|
40 | (3) |
|
Using the "static" Keyword |
|
|
43 | (3) |
|
|
44 | (1) |
|
|
45 | (1) |
|
|
46 | (9) |
|
Chapter 3 Advanced Class Design |
|
|
55 | (42) |
|
|
55 | (2) |
|
|
56 | (1) |
|
Using the "final" Keyword |
|
|
57 | (1) |
|
|
57 | (1) |
|
Final Methods and Variables |
|
|
58 | (1) |
|
|
58 | (1) |
|
Flavors of Nested Classes |
|
|
58 | (10) |
|
Static Nested Classes (or Interfaces) |
|
|
60 | (2) |
|
|
62 | (2) |
|
|
64 | (2) |
|
|
66 | (2) |
|
|
68 | (3) |
|
|
70 | (1) |
|
|
71 | (11) |
|
Declaring and Implementing Interfaces |
|
|
71 | (3) |
|
Abstract Classes vs. Interfaces |
|
|
74 | (8) |
|
|
82 | (6) |
|
|
83 | (5) |
|
|
88 | (9) |
|
Chapter 4 Generics and Collections |
|
|
97 | (48) |
|
Creating and Using Generic Classes |
|
|
97 | (14) |
|
|
102 | (1) |
|
Interoperability of Raw Types and Generic Types |
|
|
103 | (2) |
|
|
105 | (2) |
|
|
107 | (1) |
|
|
107 | (3) |
|
|
110 | (1) |
|
Create and Use Collection Classes |
|
|
111 | (9) |
|
Abstract Classes and Interfaces |
|
|
111 | (1) |
|
|
112 | (5) |
|
|
117 | (2) |
|
The Deque Interface and ArrayDeque class |
|
|
119 | (1) |
|
Comparable and Comparator Interfaces |
|
|
120 | (3) |
|
Collection Streams and Filters |
|
|
123 | (1) |
|
|
124 | (1) |
|
Method References with Streams |
|
|
125 | (1) |
|
Understanding the Stream Interface |
|
|
126 | (6) |
|
|
127 | (2) |
|
|
129 | (3) |
|
|
132 | (3) |
|
|
134 | (1) |
|
|
135 | (10) |
|
Chapter 5 Lambda Built-in Functional Interfaces |
|
|
145 | (22) |
|
Using Built-in Functional Interfaces |
|
|
145 | (9) |
|
|
146 | (3) |
|
|
149 | (1) |
|
|
150 | (2) |
|
|
152 | (2) |
|
Primitive Versions of Functional Interfaces |
|
|
154 | (4) |
|
Binary Versions of Functional Interfaces |
|
|
158 | (2) |
|
The UnaryOperator Interface |
|
|
160 | (1) |
|
|
161 | (6) |
|
Chapter 6 Java Stream API |
|
|
167 | (28) |
|
Extract Data from a Stream |
|
|
167 | (2) |
|
Search Data from a Stream |
|
|
169 | (3) |
|
|
172 | (3) |
|
Creating Optional Objects |
|
|
173 | (1) |
|
|
174 | (1) |
|
Primitive Versions of Optional<T> |
|
|
175 | (1) |
|
Stream Data Methods and Calculation Methods |
|
|
175 | (3) |
|
Sort a Collection Using Stream API |
|
|
178 | (3) |
|
Save Results to a Collection |
|
|
181 | (4) |
|
Using flatMap Method in Stream |
|
|
185 | (3) |
|
|
188 | (7) |
|
Chapter 7 Exceptions and Assertions |
|
|
195 | (40) |
|
Throwable and its Subclasses |
|
|
195 | (18) |
|
|
197 | (1) |
|
|
198 | (9) |
|
|
207 | (5) |
|
|
212 | (1) |
|
|
213 | (4) |
|
Closing Multiple Resources |
|
|
215 | (2) |
|
|
217 | (1) |
|
|
217 | (4) |
|
|
221 | (2) |
|
|
221 | (2) |
|
|
223 | (12) |
|
Chapter 8 Using the Java SE 8 Date/Time API |
|
|
235 | (22) |
|
Understanding Important Classes in java.time |
|
|
236 | (8) |
|
Using the LocalDate class |
|
|
236 | (2) |
|
Using the LocalTime Class |
|
|
238 | (1) |
|
Using the LocalDateTime Class |
|
|
239 | (1) |
|
|
240 | (1) |
|
|
241 | (2) |
|
|
243 | (1) |
|
Using the TemporalUnit Interface |
|
|
244 | (1) |
|
Dealing with Time Zones and Daylight Savings |
|
|
245 | (4) |
|
Using Time Zone--Related Classes |
|
|
246 | (2) |
|
Dealing with Daylight Savings |
|
|
248 | (1) |
|
Formatting Dates and Times |
|
|
249 | (3) |
|
|
252 | (1) |
|
|
253 | (4) |
|
Chapter 9 Java I/O Fundamentals |
|
|
257 | (30) |
|
Reading from and Writing to Console |
|
|
257 | (9) |
|
Understanding Standard Streams |
|
|
257 | (2) |
|
Understanding the Console Class |
|
|
259 | (2) |
|
Formatted Output with the Console Class |
|
|
261 | (3) |
|
|
264 | (1) |
|
Getting Input with the Console Class |
|
|
265 | (1) |
|
Using Streams to Read and Write Files |
|
|
266 | (16) |
|
Character Streams and Byte Streams |
|
|
267 | (1) |
|
|
268 | (6) |
|
|
274 | (8) |
|
|
282 | (1) |
|
|
282 | (5) |
|
Chapter 10 Java File I/O (NI0.2) |
|
|
287 | (26) |
|
|
287 | (6) |
|
|
289 | (3) |
|
|
292 | (1) |
|
|
293 | (11) |
|
Checking File Properties and Metadata |
|
|
295 | (5) |
|
|
300 | (2) |
|
|
302 | (1) |
|
|
303 | (1) |
|
Using the Stream API with NI0.2 |
|
|
304 | (4) |
|
|
308 | (5) |
|
Chapter 11 Java Concurrency |
|
|
313 | (46) |
|
Creating Threads to Execute Tasks Concurrently |
|
|
313 | (8) |
|
|
314 | (2) |
|
Thread Synchronization With synchronized Keyword |
|
|
316 | (5) |
|
|
321 | (3) |
|
|
321 | (2) |
|
|
323 | (1) |
|
|
324 | (1) |
|
Using java.util.concurrent.atomic Package |
|
|
324 | (3) |
|
Use java.util.concurrent Collections |
|
|
327 | (6) |
|
|
328 | (2) |
|
|
330 | (3) |
|
Using Callable and ExecutorService Interfaces |
|
|
333 | (4) |
|
|
334 | (1) |
|
Callable and ExecutorService |
|
|
335 | (2) |
|
Use Parallel Fork/Join Framework |
|
|
337 | (6) |
|
Useful Classes in the Fork/Join Framework |
|
|
338 | (1) |
|
Using the Fork/Join Framework |
|
|
339 | (4) |
|
|
343 | (1) |
|
|
344 | (4) |
|
Performing Correct Reductions |
|
|
346 | (1) |
|
Parallel Streams and Performance |
|
|
347 | (1) |
|
|
348 | (11) |
|
Chapter 12 Building Database Applications with JDBC |
|
|
359 | (30) |
|
|
360 | (2) |
|
|
361 | (1) |
|
|
362 | (5) |
|
|
362 | (1) |
|
Connecting to the Database Using DriverManager |
|
|
363 | (4) |
|
Querying and Updating the Database |
|
|
367 | (14) |
|
|
367 | (2) |
|
|
369 | (1) |
|
|
370 | (4) |
|
|
374 | (6) |
|
|
380 | (1) |
|
|
381 | (8) |
|
|
389 | (24) |
|
|
389 | (5) |
|
|
390 | (4) |
|
|
394 | (8) |
|
Using PropertyResourceBundle |
|
|
396 | (3) |
|
|
399 | (3) |
|
Loading a Resource Bundle |
|
|
402 | (5) |
|
Naming Convention for Resource Bundles |
|
|
402 | (5) |
|
|
407 | (6) |
|
|
413 | (64) |
Index |
|
477 | |