Table of Contents
Table of Contents
Chapter 1--A Quick Tour--gives a quick overview of the language. Programmers who are unfamiliar with object-oriented programming notions should read the quick tour, while programmers who are already familiar with object-oriented programming paradigms will find the quick tour a useful introduction to the object-oriented features of the language. The quick tour introduces some of the basic language features that examples through the rest of the book are built on.
Chapters 2, 3, 4, 5, and 6 cover the object-oriented core features of the language, namely, class declarations that define components of a program, and objects manufactured according to class definitions. Chapter 2--Classes and Objects--describes the basis of the language: classes. Chapter 3--Extending Classes--describes how an existing class can be extended, or subclassed, to create a new class with additional data and behavior. Chapter 4--Interfaces--describes how to declare interface types which are abstract descriptions of behavior that provide maximum flexibility for class designers and implementors. Chapter 5--Nested Classes and Interfaces--describes how classes and interfaces can be declared inside other classes and interfaces, and the benefits that provides. Finally, Chapter 6--Enumeration Types--covers the definition and use of type-safe enumeration constants.
Chapters 7, 8, 9, and 10 cover standard constructs common to most languages. Chapter 7--Tokens, Values and Variables--describes the tokens of the language from which statements are constructed, the types defined by the language and their allowed values, and the variables that are used to store data either in objects, arrays or locally within methods. Chapter 8--Primitives as Types--explores the relationship between the primitive types and objects of their corresponding wrapper classes, and how boxing and unboxing can transparently convert between them.
Chapter 9--Operators, and Expressions--describes the basic operators of the language, how operators are used to build expressions, and how expressions are evaluated. Chapter 10--Control Flow--describes how control statements direct the order of statement execution.
Chapter 11--Generic Types--describes how generic types are written and used, their power and their limitations.
Chapter 12--Exceptions and Assertions--describes the language's powerful error-handling capabilities, and the use of assertions to validate the expected behavior of code.
Chapter 13--Strings and Regular Expressions--describes the built-in language and runtime support for String objects, the underlying character set support, and the powerful utilities for regular expression matching.
Chapter 14--Threads--explains the language's view of multithreading. Many applications, such as graphical interface-based software, must attend to multiple tasks simultaneously. These tasks must cooperate to behave correctly, and threads meet the needs of cooperative multitasking.
Chapter 16--Annotations--describes the annotation types used to document some of the extra-linguistic properties of classes and method.
Chapter 15--Reflection--describes the type introspection mechanism and how objects of unknown type can be constructed and manipulated dynamically at runtime.
Chapter 17--Garbage Collection and Memory--talks about garbage collection, finalization, and lower-strength reference objects.
Chapter 18--Packages--describes how you can group collections of classes and interfaces into separate packages.
Chapter 19--Documentation Comments--shows how to write reference documentation in comments.
Chapters 20 through 24 cover the main packages. Chapter 20--The I/O Package--describes the input/output system, which is based on streams. Chapter 21--Collections--covers the collection or container classes such as sets and lists. Chapter 22--Miscellaneous Utilities--covers the rest of the utility classes such as bit sets, formatted output, text scanning, and random number generation. Chapter 23--System Programming--leads you through the system classes that provide access to features of the underlying platform. Chapter 24--Internationalization and Localization--covers some of the tools used to create programs that can run in many linguistic and cultural environments.
Chapter 25--Standard Packages--briefly explores the packages that are part of the standard platform, giving overviews of those packages not covered in more detail in this book.
Appendix A--Application Evolution--looks at some of the issues involved in dealing with the evolution of applications and the Java platform, and the impact this has on some of the new language features.
Appendix B--Useful Tables--has tables of information that you may find useful for quick reference.
Finally, Further Reading lists works that may be interesting for further reading on complete details, object orientation, programming with threads, software design, and other topics.
Examples and Documentation
All the code examples in the text have been compiled and run on the latest version of the language available at the time the book was written, which was the JDK 1.5.0_02 product version. Only supported features are covered--deprecated types, methods, and fields are ignored except where unavoidable, or where knowledge of the past is necessary to understand the present. We have also covered issues beyond writing programs that simply compile. Part of learning a language is to learn to use it well. For this reason, we have tried to show principles of good programming style and design.
In a few places we refer to online documentation. Development environments provide a way to automatically generate documentation (usually HTML documents) from a compiled class using the documentation comments. This documentation is normally viewed using a Web browser.
Results! Why, man, I have gotten a lot of results.I know several thousand things that won't work.
--Thomas Edison