
Java in a Nutshell / Edition 6
by Benjamin J Evans, David FlanaganView All Available Formats & Editions
ISBN-10: 1449370829
ISBN-13: 9781449370824
Pub. Date: 11/06/2014
Publisher: O'Reilly Media, Incorporated
The latest edition of Java in a Nutshell is designed to help experienced Java programmers get the most out of Java 7 and 8, but 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, the first section of this thoroughly updated book/i>
Overview
The latest edition of Java in a Nutshell is designed to help experienced Java programmers get the most out of Java 7 and 8, but 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, the first section of this thoroughly updated book 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 shows you how to perform real programming work in the Java environment.
- Get up to speed on language details, including Java 8 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
Product Details
- ISBN-13:
- 9781449370824
- Publisher:
- O'Reilly Media, Incorporated
- Publication date:
- 11/06/2014
- Edition description:
- Sixth Edition
- Pages:
- 418
- Sales rank:
- 599,606
- Product dimensions:
- 6.00(w) x 8.90(h) x 0.90(d)
Table of Contents
Foreword ix
Preface xi
Part I Introducing Java
1 Introduction to the Java Environment 3
The Language, the JVM, and the Ecosystem 3
A Brief History of Java and the JVM 7
The Lifecycle of a Java Program 9
Java Security 11
Comparing Java to Other Languages 11
Answering Some Criticisms of Java 13
2 Java Syntax from the Ground Up 17
Java Programs from the Top Down 18
Lexical Structure 18
Primitive Data Types 22
Expressions and Operators 30
Statements 46
Methods 66
Introduction to Classes and Objects 72
Arrays 77
Reference Types 84
Packages and the Java Namespace 88
Java File Structure 93
Defining and Running Java Programs 94
Summary 95
3 Object-Oriented Programming in Java 97
Overview of Classes 97
Fields and Methods 100
Creating and Initializing Objects 106
Subclasses and Inheritance 110
Data Hiding and Encapsulation 121
Abstract Classes and Methods 128
Modifier Summary 132
4 The Java Type System 135
Interfaces 136
Java Generics 142
Enums and Annotations 151
Nested Types 155
Lambda Expressions 171
Conclusion 174
5 Introduction to Object-Oriented Design in Java 177
Java Values 177
Important Methods of java.lang.Object 178
Aspects of Object-Oriented Design 183
Exceptions and Exception Handling 193
Safe Java Programming 195
6 Java's Approach to Memory and Concurrency 197
Basic Concepts of Java Memory Management 197
How the JVM Optimizes Garbage Collection 201
The HotSpot Heap 203
Finalization 206
Java's Support for Concurrency 208
Working with Threads 218
Summary 219
Part II Working with the Java Platform
7 Programming and Documentation Conventions 223
Naming and Capitalization Conventions 223
Practical Naming 225
Java Documentation Comments 226
Conventions for Portable Programs 235
8 Working with Java Collections 239
Introduction to Collections API 239
Lambda Expressions in the Java Collections 258
Conclusion 266
9 Handling Common Data Formats 267
Text 267
Numbers and Math 275
Java 8 Date and Time 280
Conclusion 287
10 File Handling and I/O 289
Classic Java I/O 289
Modern Java I/O 295
NIO Channels and Buffers 298
Async I/O 301
Networking 304
11 Classloading, Reflection, and Method Handles 311
Class Files, Class Objects, and Metadata 311
Phases of Classloading 313
Secure Programming and Classloading 315
Applied Classloading 317
Reflection 320
Dynamic Proxies 325
Method Handles 326
12 Nashorn 331
Introduction to Nashorn 331
Executing JavaScript with Nashorn 332
Nashorn and javax.script 340
Advanced Nashorn 342
Conclusion 347
13 Platform Tools and Profiles 349
Command-Line Tools 349
VisualVM 362
Java 8 Profiles 367
Conclusion 372
Index 373
Customer Reviews
Average Review: