Table of Contents....2
Title Page....16
Copyright....17
Dedication....19
Acknowledgments....20
About the Authors....22
About the Technical Editor....24
About the Technical Proofreader....24
Introduction....26
Understanding the Exam....26
Reading This Book....34
Studying for the Exam....40
Applying Test-Taking Strategies....44
Taking the Exam....49
Objective Map....51
How to Contact the Publisher....53
Assessment Test....54
Answers to Assessment Test....69
Chapter 1: Building Blocks....76
Learning About the Environment....76
Understanding the Class Structure....78
Writing a main() Method....82
Understanding Package Declarations and Imports....86
Creating Objects....96
Understanding Data Types....100
Declaring Variables....111
Initializing Variables....115
Managing Variable Scope....122
Destroying Objects....125
Summary....129
Exam Essentials....130
Review Questions....131
Chapter 2: Operators....141
Understanding Java Operators....141
Applying Unary Operators....145
Working with Binary Arithmetic Operators....149
Assigning Values....156
Comparing Values....165
Making Decisions with the Ternary Operator....176
Summary....178
Exam Essentials....179
Review Questions....180
Chapter 3: Making Decisions....189
Creating Decision-Making Statements....189
Building switch Statements and Expressions....201
Writing while Loops....223
Constructing for Loops....227
Controlling Flow with Branching....235
Summary....245
Exam Essentials....246
Review Questions....247
Chapter 4: Core APIs....264
Creating and Manipulating Strings....264
Using the StringBuilder Class....283
Understanding Equality....291
Understanding Arrays....294
Calculating with Math APIs....310
Working with Dates and Times....315
Summary....337
Exam Essentials....338
Review Questions....339
Chapter 5: Methods....349
Designing Methods....349
Declaring Local and Instance Variables....361
Working with Varargs....365
Applying Access Modifiers....368
Accessing Static Data....378
Passing Data among Methods....389
Overloading Methods....396
Summary....403
Exam Essentials....404
Review Questions....405
Chapter 6: Class Design....417
Understanding Inheritance....418
Creating Classes....424
Declaring Constructors....430
Initializing Objects....443
Inheriting Members....453
Creating Abstract Classes....465
Creating Immutable Objects....475
Summary....479
Exam Essentials....481
Review Questions....483
Chapter 7: Beyond Classes....499
Implementing Interfaces....500
Working with Enums....518
Sealing Classes....525
Encapsulating Data with Records....532
Creating Nested Classes....548
Understanding Polymorphism....561
Summary....573
Exam Essentials....575
Review Questions....576
Chapter 8: Lambdas and Functional Interfaces....595
Writing Simple Lambdas....595
Coding Functional Interfaces....602
Using Method References....606
Working with Built-in Functional Interfaces....612
Working with Variables in Lambdas....627
Summary....632
Exam Essentials....633
Review Questions....634
Chapter 9: Collections and Generics....645
Using Common Collection APIs....645
Using the List Interface....652
Using the Set Interface....658
Using the Queue and Deque Interfaces....660
Using the Map Interface....663
Sorting Data....670
Introducing Sequenced Collections....680
Reviewing Collection Types....682
Working with Generics....686
Summary....700
Exam Essentials....701
Review Questions....702
Chapter 10: Streams....710
Returning an Optional....710
Using Streams....714
Working with Primitive Streams....733
Working with Advanced Stream Pipeline Concepts....740
Summary....754
Exam Essentials....754
Review Questions....755
Chapter 11: Exceptions and Localization....764
Understanding Exceptions....764
Recognizing Exception Classes....777
Handling Exceptions....784
Automating Resource Management....795
Formatting Values....806
Supporting Internationalization and Localization....813
Loading Properties with Resource Bundles....826
Summary....835
Exam Essentials....836
Review Questions....837
Chapter 12: Modules....852
Introducing Modules....852
Creating and Running a Modular Program....856
Updating Our Example for Multiple Modules....864
Diving into the Module Declaration....872
Creating a Service....878
Discovering Modules....888
Comparing Types of Modules....906
Migrating an Application....912
Summary....920
Exam Essentials....922
Review Questions....922
Chapter 13: Concurrency....933
Introducing Threads....934
Creating Threads with the Concurrency API....947
Writing Thread-Safe Code....961
Using Concurrent Collections....979
Identifying Threading Problems....983
Working with Parallel Streams....988
Summary....1001
Exam Essentials....1002
Review Questions....1003
Chapter 14: I/O....1018
Referencing Files and Directories....1019
Operating on File and Path....1026
Introducing I/O Streams....1050
Reading and Writing Files....1060
Serializing Data....1070
Interacting with Users....1082
Working with Advanced APIs....1089
Review of Key APIs....1103
Summary....1106
Exam Essentials....1107
Review Questions....1108
Appendix: Answers to Review Questions....1122
Chapter 1: Building Blocks....1123
Chapter 2: Operators....1128
Chapter 3: Making Decisions....1133
Chapter 4: Core APIs....1141
Chapter 5: Methods....1146
Chapter 6: Class Design....1151
Chapter 7: Beyond Classes....1160
Chapter 8: Lambdas and Functional Interfaces....1166
Chapter 9: Collections and Generics....1171
Chapter 10: Streams....1177
Chapter 11: Exceptions and Localization....1182
Chapter 12: Modules....1188
Chapter 13: Concurrency....1192
Chapter 14: I/O....1198
Index....1204
End User License Agreement....1371
Unlock your Java potential and master the OCP Java SE 21 Developer exam with confidence
Dive into the OCP Oracle Certified Professional Java SE 21 Developer Study Guide: Exam 1Z0-830 for a comprehensive journey through the Java SE 21 Developer certification exam. Crafted by a team of seasoned Java professionals, this guide not only prepares you for the 1Z0-830 exam but also equips you with essential skills for both new and existing Java development roles. Enhance your knowledge, refine your skills, and discover new techniques with this expertly written roadmap.
Explore the depths of Java development, from writing methods that utilize pattern matching to building applications with virtual threads. This guide covers all you need to ace the certification and excel in your Java development career. Additionally, it provides exclusive access to Sybex's online learning environment and test bank, featuring a wealth of practice questions, electronic flashcards, and a glossary to ensure you're fully prepared for exam day.
Whether you're gearing up for the OCP Java SE 21 Developer exam or seeking to solidify your Java expertise, this study guide is an essential resource. It not only serves as a comprehensive preparatory material for the certification but also as a go-to reference for your daily programming needs. Embrace this opportunity to reduce test anxiety, enhance your Java skills, and step confidently into your role as a Java developer. Make this book your coding companion today and set the stage for a thriving career in Java development.