Java in a Nutshell: A Desktop Quick Reference
Book information
Description
This updated edition of Java in a Nutshell not only helps experienced Java programmers get the most out of Java versions 9 through 11, it’s also a learning path for new developers. Chock full of examples that demonstrate how to take complete advantage of modern Java APIs and development best practices, this thoroughly revised book includes new material on Java Concurrency Utilities. The book’s first section provides a fast-paced, no-fluff introduction to the Java programming language and the core runtime aspects of the Java platform. The second section is a reference to core concepts and APIs that explains how to perform real programming work in the Java environment. - Get up to speed on language details, including Java 9-11 changes - Learn object-oriented programming, using basic Java syntax - Explore generics, enumerations, annotations, and lambda expressions - Understand basic techniques used in object-oriented design - Examine concurrency and memory, and how they’re intertwined - Work with Java collections and handle common data formats - Delve into Java’s latest I/O APIs, including asynchronous channels - Use Nashorn to execute JavaScript on the Java Virtual Machine - Become familiar with development tools in OpenJDK Changes in the Seventh Edition: The sixth edition of this book covers Java 8, whereas this edition covers Java 11. However, the release process of Java changed significantly with the advent of Java 9, so this book is released only a year after Java 9 arrived. Java 11 is also the first long-term support (LTS) release of Java since Java 8, so it seems likely that many Java shops will jump straight to Java 11 from Java 8. With the seventh edition we have tried to update the concept of what it means to be a “Nutshell” guide. The modern Java developer needs to know more than just syntax and APIs. As the Java environment has matured, such topics as concurrency, object-oriented design, memory, and the Java type system have all grown in importance—even among mainstream developers. In this edition, we have taken the approach that only the most recent versions of Java are likely to be of interest to the majority of Java developers, so we usually only call out when new features arrived if it was with Java 8 or later. The module system (that arrived with Java 9) is still likely to be new for at least some developers, and it represents a major change. Cover......Page 1 Table of Contents......Page 6 Foreword......Page 10 Preface......Page 12 Part I. Introducting Java......Page 18 1. Introduction to the Java Environment......Page 20 The Language, the JVM, and the Ecosystem......Page 21 A Brief History of Java and the JVM......Page 25 The Lifecycle of a Java Program......Page 27 Java Security......Page 29 Comparing Java to Other Languages......Page 30 Answering Some Criticisms of Java......Page 31 2. Java Syntax from the Ground Up......Page 36 Lexical Structure......Page 37 Primitive Data Types......Page 41 Expressions and Operators......Page 50 Statements......Page 67 Methods......Page 88 Introduction to Classes and Objects......Page 95 Arrays......Page 99 Reference Types......Page 107 Packages and the Java Namespace......Page 111 Java Source File Structure......Page 116 Summary......Page 117 Overview of Classes......Page 120 Fields and Methods......Page 123 Creating and Initializing Objects......Page 129 Subclasses and Inheritance......Page 133 Data Hiding and Encapsulation......Page 145 Abstract Classes and Methods......Page 153 Modifier Summary......Page 157 4. The Java Type System......Page 160 Interfaces......Page 161 Java Generics......Page 169 Enums and Annotations......Page 181 Lambda Expressions......Page 186 Nested Types......Page 194 Non-Denotable Types and var......Page 205 Summary......Page 206 Java Values......Page 208 Important Methods of java.lang.Object......Page 209 Aspects of Object-Oriented Design......Page 214 Object-Oriented Design with Lambdas......Page 225 Exceptions and Exception Handling......Page 228 Safe Java Programming......Page 230 Basic Concepts of Java Memory Management......Page 232 How the JVM Optimizes Garbage Collection......Page 237 The HotSpot Heap......Page 239 Finalization......Page 243 Java's Support for Concurrency......Page 246 Working with Threads......Page 257 Summary......Page 259 Part II. Working with the Java Platform......Page 260 Naming and Capitalization Conventions......Page 262 Practical Naming......Page 264 Java Documentation Comments......Page 266 Doclets......Page 274 Conventions for Portable Programs......Page 275 Introduction to Collections API......Page 278 Java Streams and Lambda Expressions......Page 300 Summary......Page 308 Text......Page 310 Numbers and Math......Page 318 Java 8 Date and Time......Page 323 Summary......Page 329 Classic Java I/O......Page 330 Modern Java I/O......Page 336 NIO Channels and Buffers......Page 340 Async I/O......Page 342 Networking......Page 345 Class Files, Class Objects, and Metadata......Page 352 Phases of Classloading......Page 354 Secure Programming and Classloading......Page 357 Applied Classloading......Page 359 Reflection......Page 362 Method Handles......Page 368 12. Java Platform Modules......Page 372 Why Modules?......Page 373 Writing Your Own Modules......Page 376 Issues with Modules......Page 386 Summary......Page 388 Command-Line Tools......Page 390 Introduction to JShell......Page 406 Summary......Page 409 A. Additional Tools......Page 410 Index......Page 432
Similar books
MySQL® Notes for Professionals book
2018 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
Session C11: Ancient Cultural Landscapes in South Europe – their Ecological Setting and Evolution, Session C22: Gardeners from South America, Session S04: Agro-Pastoralism and Early Metallurgy Sessions, Session WS29: The Idea of Enclosure in Recent Iberian Prehistory, Session C88: Rhytmes et causalites des dynamiques de l'anthropisation en Europe entre 6500 ET 500 BC: Hypotheses socio-culturelles et/ou climatiques: Proceedings of the XV UISPP World Congress (Lisbon 4-9 September 2006) / Actes du XV Congrès Mondial (Lisbonne 4-9 Septembre 2006) Vol.36
2010 · PDF
THE BRITISH ARMY IN INDIA: ITS PRESERVATION BY AN APPROPRIATE CLOTHING, HOUSING, LOCATING, RECREATIVE EMPLOYMENT, AND HOPEFUL ENCOURAGEMENT OF THE TROOPS. with AN APPENDIX ON INDIA : THE CLIMATE OP ITS HILLS ; THE DEVELOPMENT OF ITS RESODRCBS, INDUSTRY, AND ARTS ; THE ADMINISTRATION OF JUSTICE ; THE BLACK ACT ; THE PROGRESS OF CHRISTIANITY ; THE TRAFFIC IN OPIUM ; THE VALUE OF INDIA ; PERMANENT CAUSES OF DISAFFECTION, AND OF THE RECENT REBELLION ; THE TRADITIONARY POLICY; MISGOVERNMENT BY NATIVE RULERS ; ANNEXATIONS OF THEIR TERRITORY, ETC.
1858 · PDF
Idries Shah 27 Books Collection : A Perfumed Scorpion, A Veiled Gazelle, Caravan of Dreams, Darkest England, Destination Mecca, Evenings with Idries Shah, Knowing How to Know, Learning How to Learn, Letters and Lectures of Idries Shah, Neglected aspects of Sufi study, Observations, Oriental Magic, Reflections, Seeker after Truth, Special Illumination, Special Problems in the study of Sufi ideas, Sufi thought and action, Tales of the Dervishes, The Dermis Probe, The Elephant in the Dark, The Englishman Handbook, Idries Shah Antology, The Magic Monastery, The natives are restless, wisdom of the Idiots PDF.
2022 · PDF
The travels of Capts. Lewis and Clarke from St. Louis, by way of the Missouri and Columbia rivers, to the Pacific ocean; performed in the years 1804, 1805 & 1806, by order of the government of the United States. Containing delineations of the manners, customs, religion, &c. of the Indians, comp. from various authentic sources, and original documents, and a summary of the Statistical view of the Indian nations, from the official communication of Meriwether Lewis. Illustrated with a map of the country, inhabited by the western tribes of Indians
1809 · PDF
Professional Linux kernel architecture ''Wrox programmer to programmer''--Cover. - ''What you are reading right now is the result of an evolution over more than seven years: After two years of writing, the first edition was published in German by Carl Hanser Verlag in 2003. It then described kernel 2.6.0. The test was used as a basis for the low-level design documentation for the EAL4+ security evaluation of Red Hat Enterprise Linux 5, requiring to update it to kernel 2.6.18 (if the EAL acronym does not mean anything to you, then Wikipedia is once more your friend). Hewlett-Packard sponsored the translation into English and has, thankfully, granted the rights to publish the result. Updates to kernel 2.6.24 were then performed specifically for this book''--P. ix
2008 · PDF