OCP Oracle Certified Professional Java SE 17 Developer Study Guide - Scott Selikoff - E-Book

OCP Oracle Certified Professional Java SE 17 Developer Study Guide E-Book

Scott Selikoff

0,0
41,99 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

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.

Sie lesen das E-Book in den Legimi-Apps auf:

Android
iOS
von Legimi
zertifizierten E-Readern

Seitenzahl: 1592

Veröffentlichungsjahr: 2022

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

Cover

Title Page

Copyright

Dedication

Acknowledgments

About the Authors

About the Technical Editor

About the Technical Proofreader

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

Understanding the Class Structure

Writing a

main()

Method

Understanding Package Declarations and Imports

Creating Objects

Understanding Data Types

Declaring Variables

Initializing Variables

Managing Variable Scope

Destroying Objects

Summary

Exam Essentials

Review Questions

Chapter 2: Operators

Understanding Java Operators

Applying Unary Operators

Working with Binary Arithmetic Operators

Assigning Values

Comparing Values

Making Decisions with the Ternary Operator

Summary

Exam Essentials

Review Questions

Chapter 3: Making Decisions

Creating Decision-Making Statements

Applying

switch

Statements

Writing

while

Loops

Constructing

for

Loops

Controlling Flow with Branching

Summary

Exam Essentials

Review Questions

Chapter 4: Core APIs

Creating and Manipulating Strings

Using the

StringBuilder

Class

Understanding Equality

Understanding Arrays

Calculating with Math APIs

Working with Dates and Times

Summary

Exam Essentials

Review Questions

Chapter 5: Methods

Designing Methods

Declaring Local and Instance Variables

Working with Varargs

Applying Access Modifiers

Accessing

static

Data

Passing Data among Methods

Overloading Methods

Summary

Exam Essentials

Review Questions

Chapter 6: Class Design

Understanding Inheritance

Creating Classes

Declaring Constructors

Initializing Objects

Inheriting Members

Creating Abstract Classes

Creating Immutable Objects

Summary

Exam Essentials

Review Questions

Chapter 7: Beyond Classes

Implementing Interfaces

Working with Enums

Sealing Classes

Encapsulating Data with Records

Creating Nested Classes

Understanding Polymorphism

Summary

Exam Essentials

Review Questions

Chapter 8: Lambdas and Functional Interfaces

Writing Simple Lambdas

Coding Functional Interfaces

Using Method References

Working with Built-in Functional Interfaces

Working with Variables in Lambdas

Summary

Exam Essentials

Review Questions

Chapter 9: Collections and Generics

Using Common Collection APIs

Using the

List

Interface

Using the

Set

Interface

Using the

Queue

and

Deque

Interfaces

Using the

Map

Interface

Comparing Collection Types

Sorting Data

Working with Generics

Summary

Exam Essentials

Review Questions

Chapter 10: Streams

Returning an

Optional

Using Streams

Working with Primitive Streams

Working with Advanced Stream Pipeline Concepts

Summary

Exam Essentials

Review Questions

Chapter 11: Exceptions and Localization

Understanding Exceptions

Recognizing Exception Classes

Handling Exceptions

Automating Resource Management

Formatting Values

Supporting Internationalization and Localization

Loading Properties with Resource Bundles

Summary

Exam Essentials

Review Questions

Chapter 12: Modules

Introducing Modules

Creating and Running a Modular Program

Updating Our Example for Multiple Modules

Diving into the Module Declaration

Creating a Service

Discovering Modules

Comparing Types of Modules

Migrating an Application

Summary

Exam Essentials

Review Questions

Chapter 13: Concurrency

Introducing Threads

Creating Threads with the Concurrency API

Writing Thread-Safe Code

Using Concurrent Collections

Identifying Threading Problems

Working with Parallel Streams

Summary

Exam Essentials

Review Questions

Chapter 14: I/O

Referencing Files and Directories

Operating on

File

and

Path

Introducing I/O Streams

Reading and Writing Files

Serializing Data

Interacting with Users

Working with Advanced APIs

Review of Key APIs

Summary

Exam Essentials

Review Questions

Chapter 15: JDBC

Introducing Relational Databases and SQL

Introducing the Interfaces of JDBC

Connecting to a Database

Working with a

PreparedStatement

Getting Data from a

ResultSet

Calling a

CallableStatement

Controlling Data with Transactions

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

End User License Agreement

List of Tables

Introduction

TABLE I.1 Exam information

Chapter 1

TABLE 1.1 Setup procedure by operating system

TABLE 1.2 Important

javac

options

TABLE 1.3 Important

java

options

TABLE 1.4 Important

jar

options

TABLE 1.5 Order for declaring a class

TABLE 1.6 Primitive types

TABLE 1.7 Wrapper classes

TABLE 1.8 Text block formatting

TABLE 1.9 Reserved words

TABLE 1.10 Tracking scope by block

Chapter 2

TABLE 2.1 Order of operator precedence

TABLE 2.2 Unary operators

TABLE 2.3 Increment and decrement operators

TABLE 2.4 Binary arithmetic operators

TABLE 2.5 Simple assignment operator

TABLE 2.6 Compound assignment operators

TABLE 2.7 Equality operators

TABLE 2.8 Relational operators

TABLE 2.9 Logical operators

TABLE 2.10 Conditional operators

Chapter 3

TABLE 3.1 Control statement usage

Chapter 4

TABLE 4.1 Rules for

indent()

and

stripIndent()

TABLE 4.2 Common formatting symbols

TABLE 4.3 Binary search rules

TABLE 4.4

Arrays.compare()

examples

TABLE 4.5 Equality vs. comparison vs. mismatch

TABLE 4.6 Methods in

LocalDate

,

LocalTime

,

LocalDateTime

, and

ZonedDateTime

...

TABLE 4.7 Where to use

Duration

and

Period

Chapter 5

TABLE 5.1 Parts of a method declaration in Figure 5.1

TABLE 5.2 Optional specifiers for methods

TABLE 5.3 Optional specifiers for instance variables

TABLE 5.4 A method in ______ can access a ______ member.

TABLE 5.5 Static vs. instance calls

TABLE 5.6 The order that Java uses to choose the right overloaded method

Chapter 6

TABLE 6.1 Class modifiers

Chapter 7

TABLE 7.1 Interface member types

TABLE 7.2 Interface member access

TABLE 7.3 Usage of the

permits

clause in sealed classes

TABLE 7.4 Modifiers in nested classes

TABLE 7.5 Nested class access rules

Chapter 8

TABLE 8.1 Valid lambdas that return a

boolean

TABLE 8.2 Invalid lambdas that should return a

boolean

TABLE 8.3 Method references

TABLE 8.4 Common functional interfaces

TABLE 8.5 Convenience methods

TABLE 8.6 Common functional interfaces for primitives

TABLE 8.7 Primitive-specific functional interfaces

TABLE 8.8 Rules for accessing a variable from a lambda body inside a method...

Chapter 9

TABLE 9.1 Factory methods to create a

List

TABLE 9.2

List

methods

TABLE 9.3

Queue

methods

TABLE 9.4

Deque

methods

TABLE 9.5 Using a

Deque

as a stack

TABLE 9.6

Map

methods

TABLE 9.7 Behavior of the

merge()

method

TABLE 9.8 Java Collections Framework types

TABLE 9.9 Collection attributes

TABLE 9.10 Comparison of

Comparable

and

Comparator

TABLE 9.11 Helper static methods for building a

Comparator

TABLE 9.12 Helper default methods for building a

Comparator

TABLE 9.13 Types of bounds

TABLE 9.14 Why we need a lower bound

Chapter 10

TABLE 10.1 Common

Optional

instance methods

TABLE 10.2 Intermediate vs. terminal operations

TABLE 10.3 Creating a source

TABLE 10.4 Terminal stream operations

TABLE 10.5 Common primitive stream methods

TABLE 10.6 Mapping methods between types of streams

TABLE 10.7 Function parameters when mapping between types of streams

TABLE 10.8 Optional types for primitives

TABLE 10.9

Spliterator

methods

TABLE 10.10 Examples of grouping/partitioning collectors

Chapter 11

TABLE 11.1 Types of exceptions and errors

TABLE 11.2 Unchecked exceptions

TABLE 11.3 Checked exceptions

TABLE 11.4 Errors

TABLE 11.5

DecimalFormat

symbols

TABLE 11.6 Common date/time symbols

TABLE 11.7 Supported date/time symbols

TABLE 11.8 Factory methods to get a

NumberFormat

TABLE 11.9 Factory methods to get a

DateTimeFormatter

TABLE 11.10

Locale.Category

values

TABLE 11.11 Picking a resource bundle for French/France with default locale ...

TABLE 11.12 Selecting resource bundle properties

Chapter 12

TABLE 12.1 Options you need to know for using modules with

javac

TABLE 12.2 Options you need to know for using modules with

java

TABLE 12.3 Access control with modules

TABLE 12.4 Reviewing services

TABLE 12.5 Reviewing directives

TABLE 12.6 Common modules

TABLE 12.7 Java modules prefixed with

java

TABLE 12.8 Java modules prefixed with

jdk

TABLE 12.9 Modes using

jmod

TABLE 12.10 Comparing command-line operations

TABLE 12.11 Options you need to know for the exam:

javac

TABLE 12.12 Options you need to know for the exam:

java

TABLE 12.13 Options you need to know for the exam:

jar

TABLE 12.14 Options you need to know for the exam:

jdeps

TABLE 12.15 Options you need to know for the exam:

jlink

TABLE 12.16 Practicing with automatic module names

TABLE 12.17 Properties of module types

TABLE 12.18 Comparing migration strategies

Chapter 13

TABLE 13.1

ExecutorService

methods

TABLE 13.2

Future

methods

TABLE 13.3

TimeUnit

values

TABLE 13.4

ScheduledExecutorService

methods

TABLE 13.5

Executors

factory methods

TABLE 13.6 Atomic classes

TABLE 13.7 Common atomic methods

TABLE 13.8

Lock

methods

TABLE 13.9 Concurrent collection classes

TABLE 13.10 Synchronized

Collections

methods

Chapter 14

TABLE 14.1 File-system symbols

TABLE 14.2 Options for creating

File

and

Path

TABLE 14.3 Common

File

and

Path

operations

TABLE 14.4 Common

File

and

Files

operations

TABLE 14.5 Common NIO.2 method arguments

TABLE 14.6

Path

APIs

TABLE 14.7 The

java.io

abstract stream base classes

TABLE 14.8 The

java.io

concrete I/O stream classes

TABLE 14.9 Common I/O read and write methods

TABLE 14.10 Common

Files

NIO.2 read and write methods

TABLE 14.11 Common I/O stream methods

TABLE 14.12 The attributes and view types

TABLE 14.13 Walking a directory with a cycle using breadth-first search

TABLE 14.14 Key APIs

Chapter 15

TABLE 15.1 CRUD operations

TABLE 15.2 SQL

TABLE 15.3 SQL runnable by the

execute

method

TABLE 15.4 Return types of

execute

methods

TABLE 15.5

PreparedStatement

methods

TABLE 15.6

ResultSet get

methods

TABLE 15.7 Sample stored procedures

TABLE 15.8 Stored procedure parameter types

TABLE 15.9

Connection

APIs for transactions

List of Illustrations

Chapter 1

FIGURE 1.1 Compiling with packages

FIGURE 1.2 Compiling with packages and directories

FIGURE 1.3 Text block

FIGURE 1.4 Your drawing after line 5

FIGURE 1.5 Your drawing after line 7

Chapter 2

FIGURE 2.1 Java operation

FIGURE 2.2 The logical truth tables for

&

,

|

, and

^

Chapter 3

FIGURE 3.1 The structure of an

if

statement

FIGURE 3.2 The structure of an

else

statement

FIGURE 3.3 The structure of a

switch

statement

FIGURE 3.4 The structure of a

switch

expression

FIGURE 3.5 The structure of a

while

statement

FIGURE 3.6 The structure of a

do

/

while

statement

FIGURE 3.7 The structure of a basic

for

loop

FIGURE 3.8 The structure of an enhanced for-each loop

FIGURE 3.9 The structure of a

break

statement

FIGURE 3.10 The structure of a

continue

statement

Chapter 4

FIGURE 4.1 Indexing for a string

FIGURE 4.2 Indexes for a substring

FIGURE 4.3 The basic structure of an array

FIGURE 4.4 An empty array

FIGURE 4.5 An initialized array

FIGURE 4.6 An array pointing to strings

FIGURE 4.7 A sparsely populated multidimensional array

FIGURE 4.8 An asymmetric multidimensional array

FIGURE 4.9 Period format

FIGURE 4.10 How daylight saving time works

Chapter 5

FIGURE 5.1 Method declaration

FIGURE 5.2 Classes used to show

private

and package access

FIGURE 5.3 Classes used to show protected access

FIGURE 5.4 Copying a reference with pass-by-value

Chapter 6

FIGURE 6.1 Subclass and superclass declarations

FIGURE 6.2 Types of inheritance

FIGURE 6.3 Java object inheritance

Chapter 7

FIGURE 7.1 Defining an interface

FIGURE 7.2 Implementing an interface

FIGURE 7.3 Interface Inheritance

FIGURE 7.4 Defining a simple enum

FIGURE 7.5 Defining a sealed class

FIGURE 7.6 Defining a record

FIGURE 7.7 Declaring a compact constructor

FIGURE 7.8 Object vs. reference

Chapter 8

FIGURE 8.1 Lambda syntax omitting optional parts

FIGURE 8.2 Lambda syntax including optional parts

Chapter 9

FIGURE 9.1 Java Collections Framework

FIGURE 9.2 Example of a

List

FIGURE 9.3 Example of a

Set

FIGURE 9.4 Examples of a

HashSet

and

TreeSet

FIGURE 9.5 Example of a

Deque

FIGURE 9.6 Working with a

Deque

FIGURE 9.7 Working with a stack

FIGURE 9.8 Example of a

Map

Chapter 10

FIGURE 10.1

Optional

FIGURE 10.2 Stream pipeline

FIGURE 10.3 Steps in running a stream pipeline

FIGURE 10.4 A stream pipeline with a limit

FIGURE 10.5 Stream pipeline with multiple intermediate operations

Chapter 11

FIGURE 11.1 Categories of exception

FIGURE 11.2 The syntax of a

try

statement

FIGURE 11.3 The syntax of a multi-catch block

FIGURE 11.4 The syntax of a

try

statement with

finally

FIGURE 11.5 The syntax of a basic try-with-resources statement

FIGURE 11.6

Locale

formats

Chapter 12

FIGURE 12.1 Design of a modular system

FIGURE 12.2 Looking inside a module

FIGURE 12.3 Contents of

zoo.animal.feeding

FIGURE 12.4 Module

zoo.animal.feeding

directory structure

FIGURE 12.5 Running a module using

java

FIGURE 12.6 Modules depending on

zoo.animal.feeding

FIGURE 12.7 Contents of

zoo.animal.care

FIGURE 12.8 Dependencies for

zoo.animal.talks

FIGURE 12.9 Contents of

zoo.animal.talks

FIGURE 12.10 Contents of

zoo.staff

FIGURE 12.11 Dependencies for

zoo.staff

FIGURE 12.12 Transitive dependency version of our modules

FIGURE 12.13 Modules in the tour application

FIGURE 12.14 Determining the order

FIGURE 12.15 Determining the order when not unique

FIGURE 12.16 Bottom-up migration

FIGURE 12.17 Top-down migration

FIGURE 12.18 First attempt at decomposition

FIGURE 12.19 Removing the cyclic dependencies

Chapter 13

FIGURE 13.1 Process model

FIGURE 13.2 Thread states

FIGURE 13.3

ExecutorService

life cycle

FIGURE 13.4 Lack of thread synchronization

FIGURE 13.5 Thread synchronization using atomic operations

FIGURE 13.6 Race condition on user creation

Chapter 14

FIGURE 14.1 Directory and file hierarchy

FIGURE 14.2 Relative paths using path symbols

FIGURE 14.3 I/O and NIO.2 class and interface relationships

FIGURE 14.4 Comparing file uniqueness

FIGURE 14.5 Visual representation of an I/O stream

FIGURE 14.6 Serialization process

FIGURE 14.7 File system with cycle

FIGURE 14.8 Diagram of I/O stream classes

Chapter 15

FIGURE 15.1 Tables in our relational database

FIGURE 15.2 Key JDBC interfaces

FIGURE 15.3 The JDBC URL format

FIGURE 15.4 Types of statements

FIGURE 15.5 The

ResultSet

cursor

Guide

Cover

Table of Contents

Title Page

Copyright

Dedication

Acknowledgments

About the Authors

About the Technical Editor

Introduction

Begin Reading

Appendix: Answers to the Review Questions

Index

End User License Agreement

Pages

i

ii

iii

iv

v

vi

xxiii

xxiv

xxv

xxvi

xxvii

xxviii

xxix

xxx

xxxi

xxxii

xxxiii

xxxiv

xxxv

xxxvi

xxxvii

xxxviii

xxxix

xl

xli

xlii

xliii

xliv

xlv

xlvi

xlvii

xlviii

xlix

l

li

lii

liii

liv

lv

lvi

lvii

lviii

lix

lx

lxi

lxii

lxiii

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

256

257

258

259

260

261

262

263

264

265

266

267

268

269

270

271

272

273

274

275

276

277

278

279

280

281

282

283

284

285

286

287

288

289

290

291

292

293

294

295

296

297

298

299

300

301

302

303

304

305

306

307

308

309

310

311

312

313

314

315

316

317

318

319

320

321

322

323

324

325

326

327

328

329

330

331

332

333

334

335

336

337

338

339

340

341

342

343

344

345

346

347

348

349

350

351

352

353

354

355

356

357

358

359

360

361

362

363

364

365

366

367

368

369

370

371

372

373

374

375

376

377

378

379

380

381

382

383

384

385

386

387

388

389

390

391

392

393

394

395

396

397

398

399

400

401

402

403

404

405

406

407

408

409

410

411

412

413

414

415

416

417

418

419

420

421

422

423

424

425

426

427

428

429

430

431

432

433

434

435

436

437

438

439

440

441

442

443

444

445

446

447

448

449

450

451

452

453

454

455

456

457

458

459

460

461

463

464

465

466

467

468

469

470

471

472

473

474

475

476

477

478

479

480

481

482

483

484

485

486

487

488

489

490

491

492

493

494

495

496

497

498

499

500

501

502

503

504

505

506

507

508

509

510

511

512

513

514

515

516

517

518

519

520

521

522

523

524

525

526

527

528

529

531

532

533

534

535

536

537

538

539

540

541

542

543

544

545

546

547

548

549

550

551

552

553

554

555

556

557

558

559

560

561

562

563

564

565

566

567

568

569

570

571

572

573

574

575

576

577

578

579

580

581

582

583

584

585

586

587

588

589

590

591

592

593

594

595

596

597

598

599

600

601

602

603

604

605

606

607

608

609

610

611

612

613

614

615

616

617

618

619

620

621

622

623

624

625

626

627

628

629

630

631

632

633

634

635

636

637

638

639

640

641

642

643

644

645

646

647

648

649

650

651

652

653

654

655

656

657

658

659

661

662

663

664

665

666

667

668

669

670

671

672

673

674

675

676

677

678

679

680

681

682

683

684

685

686

687

688

689

690

691

692

693

694

695

696

697

698

699

700

701

702

703

704

705

706

707

708

709

710

711

712

713

714

715

716

717

718

719

720

721

722

723

724

725

726

727

728

729

730

731

732

733

734

735

736

737

738

739

740

741

742

743

744

745

746

747

748

749

750

751

752

753

754

755

756

757

758

759

760

761

762

763

764

765

766

767

768

769

770

771

772

773

774

775

776

777

778

779

780

781

782

783

785

786

787

788

789

790

791

792

793

794

795

796

797

798

799

800

801

802

803

804

805

806

807

808

809

810

811

812

813

814

815

816

817

818

819

820

821

822

823

824

825

826

827

828

829

830

831

832

833

834

835

836

837

838

839

840

841

842

843

844

845

846

847

848

849

850

851

852

853

854

855

856

857

858

859

860

861

862

863

864

865

866

867

868

869

870

871

872

873

874

875

876

877

878

879

880

881

882

883

884

885

886

887

888

889

890

891

892

893

894

895

896

897

898

899

900

901

902

903

904

905

906

907

908

909

910

911

912

913

914

915

916

917

918

919

920

921

922

923

924

925

926

927

928

929

930

931

932

933

934

935

936

937

938

939

940

941

942

943

944

945

946

947

948

949

950

951

952

953

954

955

956

957

958

959

960

961

963

964

965

966

967

968

969

970

971

972

973

974

975

976

977

978

979

980

981

982

983

984

985

986

987

988

989

990

991

OCPOracle® Certified Professional Java SE 17 DeveloperStudy Guide

Exam 1Z0-829

 

 

Scott Selikoff

Jeanne Boyarsky

 

Copyright © 2022 by John Wiley & Sons, Inc. All rights reserved.

Published by John Wiley & Sons, Inc., Hoboken, New Jersey.Published simultaneously in Canada and the United Kingdom.

978-1-119-86458-5978-1-119-86460-8 (ebk.)978-1-119-86459-2 (ebk.)

No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise, except as permitted under Section 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 750-4470, or on the web at www.copyright.com. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at www.wiley.com/go/permission.

Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Website is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Website may provide or recommendations it may make. Further, readers should be aware the Internet Websites listed in this work may have changed or disappeared between when this work was written and when it is read.

For general information on our other products and services or for technical support, please contact our Customer Care Department within the United States at (800) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.

Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic formats. For more information about Wiley products, visit our web site at www.wiley.com.

Library of Congress Control Number: 2022932106

Trademarks: WILEY, the Wiley logo, Sybex, and the Sybex logo are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries, and may not be used without written permission. Oracle and java are registered trademarks of Oracle, Inc. All other trademarks are the property of their respective owners. John Wiley & Sons, Inc. is not associated with any product or vendor mentioned in this book.

Cover image: © Jeremy Woodhouse/Getty Images

Cover design: Wiley

For my mom who I love dearly: you get one penny for each page of this book that you read.

—Scott

 

To the Java conference scene and its post-COVID recovery.

—Jeanne

Acknowledgments

Scott and Jeanne would like to thank numerous individuals for their contributions to this book. Thank you to Kezia Endsley and Archana Pragash for guiding us through the process and making the book better in many ways. Thank you to Janeice DelVecchio for being our technical editor as we wrote this book. Janeice pointed out many subtle errors in addition to the big ones. Thank you to Elena Felder for being our technical proofreader and finding the errors that we managed to sneak by Janeice. And a special thank you to our copy editor Tiffany Taylor, for finding subtle errors that everyone (including us!) missed. This book also wouldn't be possible without many people at Wiley, including Kenyon Brown, Pete Gaughan, Christine O'Connor, and many others.

Scott could not have reached this point without his wife, Patti, and family, whose love and support make this book possible. He would like to thank his twin daughters, Olivia and Sophia, and youngest daughter, Elysia, for their patience and understanding and bringing him a cup of cold brew coffee when it was “time for Daddy to work in his office!” Scott would like to extend his gratitude to his wonderfully patient co-author, Jeanne, on this, their eighth book. He doesn't know how she puts up with him, but he's glad she does and is thrilled at the quality of books we produce. Finally, Scott would like to thank his mother, Barbara Selikoff (a retired teacher), for teaching him the value of education, and his father, Mark Selikoff, for instilling in him the benefits of working hard.

Jeanne would personally like to thank everyone who kept her sane during the COVID pandemic, especially Dani, Elena, Janeice, Joslyn, Norm, Rodrigo, Scott, and Wendy, along with the NYJavaSIG leadership team. She would also like to thank the KCDC (Kansas City Development Conference) leadership team for holding the first in-person conference she attended where she could test book material on unsuspecting attendees. Scott was a great co-author, improving everything Jeanne wrote while writing his own chapters. A big thank you to everyone at CodeRanch.com who asked and responded to questions and comments about our books. Finally, Jeanne would like to thank all of the new programmers at CodeRanch.com and FIRST robotics teams FRC 694 and FTC 310/479/8365 for the constant reminders of how new programmers think.

Both Scott and Jeanne would like to give a big thank you to the readers of our books. Hearing from all of you who enjoyed the book and passed the exam is a great feeling. We'd also like to thank those who pointed out errors and made suggestions for improvements to the Java 17 book. As of January 2022, the top two were Tomasz Kasprzyk and Jos Roseboom.

About the Authors

Scott Selikoff is a professional software developer and author with over 20 years of experience developing full-stack database-driven systems. Skilled in a plethora of software languages and platforms, Scott currently works as a Staff Software Engineer at Google, specializing in Architecture and Cloud Services.

A native of Toms River, New Jersey, Scott achieved his Bachelor of Arts degree from Cornell University in Mathematics and Computer Science in 2002 after three years of study. In 2003, he received his Master of Engineering degree in Computer Science, also from Cornell University. As someone with a deep love of education, Scott has always enjoyed teaching others new concepts. Scott is a Leader of the Garden State Java User Group, helping to facilitate discussions and exchange of ideas within the community. He's also taught lectures at multiple universities and conferences.

Scott lives in New Jersey with his loving wife, Patti; three amazing daughters, twins Olivia and Sophia and little Elysia; a very playful dog, Georgette; and three silly cats, Snowball, Sugar, and Minnie Mouse. In his spare time, he plays violin in the Toms River Multigenerational Orchestra. You can find out more about Scott at www.linkedin.com/in/selikoff or follow him on Twitter @ScottSelikoff.

Jeanne Boyarsky was selected as a Java Champion in 2019 and is a leader of the NYJavaSIG. She has worked as a Java developer for more than 20 years at a bank in New York City where she develops, mentors, and conducts training. Besides being a senior moderator at CodeRanch.com in her free time, she works on the forum code base. Jeanne also mentors the programming division of a FIRST robotics team, where she works with students just getting started with Java. She also speaks at several conferences each year.

Jeanne got her Bachelor of Arts degree in 2002 and her Master in Computer Information Technology degree in 2005. She enjoyed getting her Master's degree in an online program while working full time. This was before online education was cool! Jeanne is also a Distinguished Toastmaster and a Scrum Master. You can find out more about Jeanne at www.jeanneboyarsky.com or follow her on Twitter @JeanneBoyarsky.

Scott and Jeanne are both moderators on the CodeRanch.com forums and can be reached there for question and comments. They also co-author a technical blog called Down Home Country Coding at www.selikoff.net.

In addition to this book, Scott and Jeanne are authors of seven best-selling Java books:

OCA: Java 8 Programmer I Study Guide

(Sybex, 2015)

OCP: Java 8 Programmer II Study Guide

(Sybex, 2016)

OCA / OCP Java 8 Programmer Practice Tests

(Sybex, 2017)

OCP Java 11 Programmer I Study Guide

(Sybex, 2019)

OCP Java 11 Programmer II Study Guide

(Sybex, 2020)

OCP Java 11 Developer Complete Study Guide

(Sybex, 2020)

OCP Java 11 Practice Tests

(Sybex, 2021)

They are currently in the process of writing an OCP Java 17 Developer Practice Tests book due out later this year.

About the Technical Editor

Janeice DelVecchio has been a professional software developer for 12 years and has had a lifelong love of programming and computers. Editing technical books is a fun task for her because she likes finding and fixing defects of all types. In her day job she uses a very broad range of skills with technologies including cloud computing, process automation, advanced unit testing, and devops. She also volunteers at CodeRanch.com, where she runs the Java class known as the Cattle Drive. She is an expert with the Java programming language. If you ask her which language is the best, she will tell you that languages are tools and to pick the one that fits your use case. The first language she learned was BASIC, and one day she hopes to learn gaming development. In her spare time, she enjoys cooking, solving puzzles, playing video games, and raising chickens. She loves eating sushi, drinking craft beer, and petting dogs – her guilty pleasure is 1980s pop music. She lives in Litchfield County, Connecticut.

About the Technical Proofreader

Elena Felder got into Java development back when the language lacked even generics, and she is delighted that the language, its tooling, and its community have continued growing and adapting to successfully keep up with the ever-changing world. She proofread one of Jeanne and Scott’s first Java 8 Certification Study Guide chapters for fun and ended up doing it professionally ever since.