Clear, Concise Guide to the Core Language and Libraries--Updated through Java 17 Modern Java introduces major enhancements that impact the core Java technologies and APIs at the heart of the Java platform. Many old Java idioms are no longer needed, and new features and programming paradigms can make you far more effective. However, navigating these changes can be challenging. Core Java for the Impatient, Third Edition, is a complete yet concise guide that reflects all changes through Java SE 17, Oracle's latest Long-Term Support (LTS) release. Written by Cay S. Horstmann--author of the classic two-volume Core Java--this indispensable tutorial offers a faster, easier pathway for learning modern Java. Horstmann covers everything working developers need to know, including the powerful concepts of lambda expressions and streams, modern constructs such as records and sealed classes, and sophisticated concurrent programming techniques. Given the size and scope of Java 17, there's plenty to cover, but it's presented in small chunks organized for quick access and easy understanding, with plenty of practical insights and sample code to help you quickly apply all that's new. Test code as you create it with JShellImprove your object-oriented design with records and sealed classesEffectively use text blocks, switch expressions, and pattern matchingUnderstand functional programming with lambda expressionsStreamline and optimize data management with the Streams APIUse modern library features and threadsafe data structures to implement concurrency reliablyWork with the modularized Java API and third-party modulesTake advantage of API improvements for working with collections, input/output, regular expressions, and processesLearn the APIs for date/time processing and internationalization Whether you're an experienced developer just getting started with modern Java, or have been programming with Java for years, this guide will help you write more robust, efficient, and secure Java code. Register your book for convenient access to downloads, updates, and/or corrections as they become available. See inside book for details.
Les mer
Preface xxiiiAcknowledgments xxvAbout the Author xxvii Chapter 1: Fundamental Programming Structures 11.1 Our First Program 21.2 Primitive Types 111.3 Variables 141.4 Arithmetic Operations 171.5 Strings 251.6 Input and Output 351.7 Control Flow 381.8 Arrays and Array Lists 461.9 Functional Decomposition 56Exercises 58 Chapter 2: Object-Oriented Programming 612.1 Working with Objects 622.2 Implementing Classes 672.3 Object Construction 712.4 Records 762.5 Static Variables and Methods 792.6 Packages 832.7 Nested Classes 902.8 Documentation Comments 95Exercises 100 Chapter 3: Interfaces and Lambda Expressions 1053.1 Interfaces 1063.2 Static, Default, and Private Methods 1133.3 Examples of Interfaces 1173.4 Lambda Expressions 1213.5 Method and Constructor References 1243.6 Processing Lambda Expressions 1273.7 Lambda Expressions and Variable Scope 1313.8 Higher-Order Functions 1353.9 Local and Anonymous Classes 137Exercises 139 Chapter 4: Inheritance and Reflection 1434.1 Extending a Class 1444.2 Inheritance Hierarchies 1504.3 Object: The Cosmic Superclass 1574.4 Enumerations 1664.5 Runtime Type Information and Resources 1704.6 Reflection 179Exercises 188 Chapter 5: Exceptions, Assertions, and Logging 1915.1 Exception Handling 1925.2 Assertions 2045.3 Logging 206Exercises 214 Chapter 6: Generic Programming 2196.1 Generic Classes 2206.2 Generic Methods 2216.3 Type Bounds 2226.4 Type Variance and Wildcards 2236.5 Generics in the Java Virtual Machine 2286.6 Restrictions on Generics 2316.7 Reflection and Generics 238Exercises 241 Chapter 7: Collections 2477.1 An Overview of the Collections Framework 2487.2 Iterators 2527.3 Sets 2547.4 Maps 2557.5 Other Collections 2597.6 Views 264Exercises 267 Chapter 8: Streams 2718.1 From Iterating to Stream Operations 2728.2 Stream Creation 2738.3 The filter, map, and flatMap Methods 2768.4 Extracting Substreams and Combining Streams 2788.5 Other Stream Transformations 2798.6 Simple Reductions 2808.7 The Optional Type 2818.8 Collecting Results 2868.9 Collecting into Maps 2878.10 Grouping and Partitioning 2898.11 Downstream Collectors 2898.12 Reduction Operations 2928.13 Primitive Type Streams 2948.14 Parallel Streams 295Exercises 298 Chapter 9: Processing Input and Output 3019.1 Input/Output Streams, Readers, and Writers 3029.2 Paths, Files, and Directories 3129.3 HTTP Connections 3209.4 Regular Expressions 3239.5 Serialization 333Exercises 344 Chapter 10: Concurrent Programming 34710.1 Concurrent Tasks 34810.2 Asynchronous Computations 35310.3 Thread Safety 36010.4 Parallel Algorithms 36610.5 Threadsafe Data Structures 36810.6 Atomic Counters and Accumulators 37310.7 Locks and Conditions 37510.8 Threads 38110.9 Processes 386Exercises 390 Chapter 11: Annotations 39711.1 Using Annotations 39811.2 Defining Annotations 40311.3 Standard Annotations 40611.4 Processing Annotations at Runtime 41011.5 Source-Level Annotation Processing 413Exercises 417 Chapter 12: The Date and Time API 42112.1 The Time Line 42212.2 Local Dates 42412.3 Date Adjusters 42812.4 Local Time 42912.5 Zoned Time 43012.6 Formatting and Parsing 43312.7 Interoperating with Legacy Code 436Exercises 437 Chapter 13: Internationalization 44113.1 Locales 44213.2 Number Formats 44713.3 Currencies 44813.4 Date and Time Formatting 44913.5 Collation and Normalization 45113.6 Message Formatting 45313.7 Resource Bundles 45513.8 Character Encodings 45813.9 Preferences 459Exercises 461 Chapter 14: Compiling and Scripting 46314.1 The Compiler API 46314.2 The Scripting API 467Exercises 472 Chapter 15: The Java Platform Module System 47515.1 The Module Concept 47615.2 Naming Modules 47815.3 The Modular “Hello, World!” Program 47815.4 Requiring Modules 48015.5 Exporting Packages 48215.6 Modules and Reflective Access 48515.7 Modular JARs 48815.8 Automatic Modules 48915.9 The Unnamed Module 49115.10 Command-Line Flags for Migration 49115.11 Transitive and Static Requirements 49315.12 Qualified Exporting and Opening 49515.13 Service Loading 49615.14 Tools for Working with Modules 497Exercises 499 Index 501
Les mer
Produktdetaljer
ISBN
9780138052102
Publisert
2022-10-25
Utgave
3. utgave
Utgiver
Vendor
Addison Wesley
Vekt
930 gr
Høyde
234 mm
Bredde
179 mm
Dybde
30 mm
Aldersnivå
P, 06
Språk
Product language
Engelsk
Format
Product format
Heftet
Antall sider
576
Forfatter
Biographical note
Cay S. Horstmann is principal author of Core Java, Volumes I and II, Twelfth Edition (Pearson, 2022), and author of Modern JavaScript for the Impatient (Addison-Wesley, 2020) and Scala for the Impatient, Second Edition (Addison-Wesley, 2016). He has written more than a dozen other books for professional programmers and computer science students. He is professor emeritus of computer science at San Jose State University and a Java Champion.