![](https://csdnimg.cn/release/download_crawler_static/5109676/bg10.jpg)
■ INTRODUCTION
xiv
Note: You can download this book’s source code by pointing your web browser to
www.apress.com/book/view/1430231564 and clicking the Source Code link under Book Resources.
Although most of this code is compilable with Java version 6, you will need Java version 7 to compile one
of the applications.
Chapter 1 introduces you to Java by first focusing on Java’s dual nature (language and
platform). It then briefly introduces you to Sun’s/Oracle’s Java SE, Java EE, and Java ME editions
of the Java development software, as well as Google’s Android edition. You next learn how to
download and install the Java SE Development Kit (JDK), and learn some Java basics by
developing and playing with a pair of simple Java applications. After receiving a brief
introduction to the NetBeans and Eclipse IDEs, you learn about application development in the
context of Four of a Kind, a console-based card game.
Chapter 2 starts you on an in-depth journey of the Java language by focusing on language
fundamentals (such as types, expressions, variables, and statements) in the contexts of classes
and objects. Because applications are largely based on classes, it is important to learn how to
architect classes correctly, and this chapter shows you how to do so.
Chapter 3 adds to Chapter 2’s pool of object-based knowledge by introducing you to those
language features that take you from object-based applications to object-oriented applications.
Specifically, you learn about features related to inheritance, polymorphism, and interfaces. While
exploring inheritance, you learn about Java’s ultimate superclass. Also, while exploring interfaces,
you discover the real reason for their inclusion in the Java language; interfaces are not merely a
workaround for Java’s lack of support for multiple implementation inheritance, but serve a
higher purpose.
Chapter 4 introduces you to four categories of advanced language features: nested types,
packages, static imports, and exceptions. While discussing nested types, I briefly introduce the
concept of a closure and state that closures will appear in Java version 7 (which many expect to
arrive later this year).
Note: I wrote this book several months before Java version 7’s expected arrival in the fall of 2010.
Although I have tried to present an accurate portrayal of version 7–specific language features, it is possible
that feature syntax may differ somewhat from what is presented in this book. Also, I only discuss closures
briefly because this feature was still in a state of flux while writing this book. For more information about
closures and other functional programming concepts (such as lambdas) being considered for Java version 7, I
recommend that you check out articles such as “Functional Programming Concepts in JDK 7” by Alex Collins
(
http://java.dzone.com/articles/lambdas-closures-jdk-7).
Chapter 5 continues to explore advanced language features by focusing on assertions,
annotations, generics, and enums. Although the topic of generics has brought confusion to many
developers, I believe that my discussion of this topic will clear up much of the murkiness. Among
other items, you learn how to interpret type declarations such as Enum<E extends Enum<E>>.
Chapter 6 begins a trend that focuses more on APIs than language features. This chapter first
introduces you to many of Java’s math-oriented types (such as Math, StrictMath, BigDecimal, and
BigInteger), and also introduces you to Java’s strictfp reserved word. It then looks at the
Package class, primitive wrapper classes, and the References API.