![](https://csdnimg.cn/release/download_crawler_static/10567592/bg13.jpg)
Introduction
How This Book Came About
My first encounter with the Java programming language was during a one-week Java training session in 1997.
I did not get a chance to use Java in a project until 1999. I read two Java books and took a Java 2 programmer
certification examination. I did very well on the test, scoring 95 percent. The three questions that I missed
on the test made me realize that the books that I had read did not adequately cover details of all the topics. I
made up my mind to write a book on the Java programming language. So, I formulated a plan to cover most
of the topics that a Java developer needs to use Java effectively in a project, as well as to become certified. I
initially planned to cover all essential topics in Java in 700 to 800 pages.
As I progressed, I realized that a book covering most of the Java topics in detail could not be written in
700 to 800 pages. One chapter alone that covered data types, operators, and statements spanned 90 pages.
I was then faced with the question, “Should I shorten the content of the book or include all the details that
I think a Java developer needs?” I opted for including all the details in the book, rather than shortening
its content to maintain the original number of pages. It has never been my intent to make lots of money
from this book. I was never in a hurry to finish this book because that rush could have compromised the
quality and coverage. In short, I wrote this book to help the Java community understand and use the Java
programming language effectively, without having to read many books on the same subject. I wrote this
book with the plan that it would be a comprehensive one-stop reference for everyone who wants to learn
and grasp the intricacies of the Java programming language.
One of my high school teachers used to tell us that if one wanted to understand a building, one
must first understand the bricks, steel, and mortar that make up the building. The same logic applies to
most of the things that we want to understand in our lives. It certainly applies to an understanding of the
Java programming language. If you want to master the Java programming language, you must start by
understanding its basic building blocks. I have used this approach throughout this book, endeavoring
to build upon each topic by describing the basics first. In the book, you will rarely find a topic described
without first learning about its background. Wherever possible, I tried to correlate the programming
practices with activities in daily life. Most of the books about the Java programming language available in
the market either do not include any pictures at all or have only a few. I believe in the adage, “A picture is
worth a thousand words.” To a reader, a picture makes a topic easier to understand and remember. I have
included plenty of illustrations in the book to aid readers in understanding and visualizing the concepts.
Developers who have little or no programming experience have difficulty in putting things together to make
it a complete program. Keeping them in mind, the book contains over 390 complete Java programs that are
ready to be compiled and run.
I spent countless hours doing research when writing this book. My main sources were the Java
Language Specification, whitepapers, and articles on Java topics, and Java Specification Requests (JSRs).
I also spent quite a bit of time reading the Java source code to learn more about some of the Java topics.
Sometimes, it took a few months of researching a topic before I could write the first sentence on it. Finally, it
was always fun to play with Java programs, sometimes for hours, to add them to the book.