Preface

Java is one of the world’s most important and widely used computer languages. Furthermore, it has held that distinction for many years. Unlike some other computer languages whose influence has waned with the passage of time, Java’s has grown stronger. Java leapt to the forefront of Internet programming with its first release. Each subsequent version has solidified that position. Today, it is still the first and best choice for developing web-based applications. It is also a powerful, general-purpose programming language suitable for a wide variety of purposes. Simply put: much of the modern world runs on Java code. Java really is that important.

A key reason for Java’s success is its agility. Since its original 1.0 release, Java has continually adapted to changes in the programming environment and to changes in the way that programmers program. Most importantly, it has not just followed the trends, it has helped create them. Java’s ability to accommodate the fast rate of change in the computing world is a crucial part of why it has been and continues to be so successful.

Since this book was first published in 1996, it has gone through several editions, each reflecting the ongoing evolution of Java. This is the tenth edition, and it has been updated for Java SE 9 (JDK 9). As a result, this edition of the book contains a substantial amount of new material because Java SE 9 adds several new features to the Java language. The most important is modules, which enable you to specify the relationships and dependencies of the code that comprises an application. They can also affect the accessibility of elements. The addition of modules represents one of the most profound changes made to the Java language, adding both a new syntax element and ten new keywords. Modules also significantly impact the Java API library because its packages are now organized into modules. Furthermore, to support modules, new tools have been added, existing tools have been updated, and a new file format has been defined. Because of their importance, the entirety of Chapter 16 is devoted to modules.

In addition to modules, there are several other new features provided by JDK 9. One of the most interesting is JShell. JShell is a tool that offers an interactive environment in which it is easy to experiment with code snippets without having to write an entire program. Both beginners and experienced pros will find it quite useful. An introduction to JShell is found in Appendix C. As with previous releases, JDK 9 contains a number of smaller updates and enhancements to both the Java language and its API libraries. Thus, updated material is found throughout this book. One final point: Java SE 9 deprecates applets and the applet API. Thus, they are no longer covered in the main book. However, a brief introduction to applets is provided in Appendix D.

A Book for All Programmers

This book is for all programmers, whether you are a novice or an experienced pro. The beginner will find its carefully paced discussions and many examples especially helpful. Its in-depth coverage of Java’s more advanced features and libraries will appeal to the pro. For both, it offers a lasting resource and handy reference.

What’s Inside

This book is a comprehensive guide to the Java language, describing its syntax, keywords, and fundamental programming principles. Significant portions of the Java API library are also examined. The book is divided into five parts, each focusing on a different aspect of the Java programming environment.

Part I presents an in-depth tutorial of the Java language. It begins with the basics, including such things as data types, operators, control statements, and classes. It then moves on to inheritance, packages, interfaces, exception handling, and multithreading. Next, it describes annotations, enumerations, autoboxing, generics, and lambda expressions. I/O is also introduced. The final chapter in Part I covers modules. As mentioned, modules are the single most important new feature in Java SE 9.

Part II examines key aspects of Java’s standard API library. Topics include strings, I/O, networking, the standard utilities, the Collections Framework, the AWT, event handling, imaging, concurrency (including the Fork/Join Framework), regular expressions, and the stream library.

Part III offers three chapters that introduce Swing.

Part IV presents three chapters that introduce JavaFX.

Part V contains two chapters that show examples of Java in action. The first discusses Java Beans. The second presents an introduction to servlets.

Special Thanks

I want to give special thanks to Patrick Naughton, Joe O’Neil, and Danny Coward.

Patrick Naughton was one of the creators of the Java language. He also helped write the first edition of this book. For example, among many other contributions, much of the material in Chapters 21, 23, and 27 was initially provided by Patrick. His insights, expertise, and energy contributed greatly to the success of that book.

During the preparation of the second and third editions of this book, Joe O’Neil provided initial drafts for the material now found in Chapters 30, 32, 37, and 38 of this edition. Joe helped on several of my books, and his input has always been top-notch.

Danny Coward is the technical editor for this edition of the book. Danny has worked on several of my books, and his advice, insights, and suggestions have always been of great value and much appreciated.

HERBERT SCHILDT

For Further Study

Java: The Complete Reference is your gateway to the Herb Schildt series of Java programming books. Here are others that you will find of interest:

Herb Schildt’s Java Programming Cookbook

Java: A Beginner’s Guide

Introducing JavaFX 8 Programming

Swing: A Beginner’s Guide

The Art of Java

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.131.212