Contents

About the Author

About the Technical Reviewers

Acknowledgments

Introduction

images Chapter 1: Getting Started With Java

What Is Java?

Java Is a Language

Java Is a Platform

Java SE, Java EE, Java ME, and Android

Installing and Exploring the JDK

Installing and Exploring the Eclipse IDE

Overview of Java APIs

Language-Support and Other Language-Oriented APIs

Collections-Oriented APIs

Additional Utility APIs

Classic I/O APIs

Networking APIs

New I/O APIs

Database APIs

Summary

images Chapter 2: Learning Language Fundamentals

Learning Comments

Single-Line Comments

Multiline Comments

Javadoc Comments

Learning Identifiers

Learning Types

Primitive Types

User-Defined Types

Array Types

Learning Variables

Learning Expressions

Simple Expressions

Compound Expressions

Learning Statements

Assignment Statements

Decision Statements

Loop Statements

Break and Labeled Break Statements

Continue and Labeled Continue Statements

Summary

images Chapter 3: Discovering Classes and Objects

Declaring Classes and Instantiating Objects

Declaring Classes

Instantiating Objects with the New Operator and a Constructor

Specifying Constructor Parameters and Local Variables

Encapsulating State and Behaviors

Representing State via Fields

Representing Behaviors via Methods

Hiding Information

Initializing Classes and Objects

Class Initializers

Instance Initializers

Initialization Order

Collecting Garbage

Revisiting Arrays

Summary

images Chapter 4: Discovering Inheritance, Polymorphism, and Interfaces

Building Class Hierarchies

Extending Classes

The Ultimate Superclass

Composition

The Trouble with Implementation Inheritance

Changing Form

Upcasting and Late Binding

Abstract Classes and Abstract Methods

Downcasting and Runtime Type Identification

Covariant Return Types

Formalizing Class Interfaces

Declaring Interfaces

Implementing Interfaces

Extending Interfaces

Why Use Interfaces?

Summary

images Chapter 5: Mastering Advanced Language Features Part 1

Mastering Nested Types

Static Member Classes

Nonstatic Member Classes

Anonymous Classes

Local Classes

Interfaces within Classes

Mastering Packages

What Are Packages?

The Package Statement

The Import Statement

Searching for Packages and Types

Playing with Packages

Packages and JAR Files

Mastering Static Imports

Mastering Exceptions

What Are Exceptions?

Representing Exceptions in Source Code

Throwing Exceptions

Handling Exceptions

Performing Cleanup

Summary

images Chapter 6: Mastering Advanced Language Features Part 2

Mastering Assertions

Declaring Assertions

Using Assertions

Avoiding Assertions

Enabling and Disabling Assertions

Mastering Annotations

Discovering Annotations

Declaring Annotation Types and Annotating Source Code

Processing Annotations

Mastering Generics

Collections and the Need for Type Safety

Generic Types

Generic Methods

Arrays and Generics

Mastering Enums

The Trouble with Traditional Enumerated Types

The Enum Alternative

The Enum Class

Summary

images Chapter 7: Exploring the Basic APIs Part 1

Exploring the Math APIs

Math and StrictMath

BigDecimal

BigInteger

Exploring String Management

String

StringBuffer and StringBuilder

Obtaining Package Information

Summary

images Chapter 8: Exploring the Basic APIs Part 2

Exploring the Primitive Type Wrapper Classes

Boolean

Character

Float and Double

Integer, Long, Short, and Byte

Number

Exploring Threads

Runnable and Thread

Thread Synchronization

Exploring System Capabilities

System

Runtime and Process

Summary

images Chapter 9: Exploring the Collections Framework

Exploring Collections Framework Fundamentals

Comparable Versus Comparator

Iterable and Collection

Exploring Lists

ArrayList

LinkedList

Exploring Sets

TreeSet

HashSet

EnumSet

Exploring Sorted Sets

Exploring Navigable Sets

Exploring Queues

PriorityQueue

Exploring Deques

ArrayDeque

Exploring Maps

TreeMap

HashMap

IdentityHashMap

EnumMap

Exploring Sorted Maps

Exploring Navigable Maps

Exploring the Arrays and Collections Utility APIs

Exploring the Legacy Collection APIs

Summary

images Chapter 10: Exploring Additional Utility APIs

Exploring the Concurrency Utilities

Executors

Synchronizers

Concurrent Collections

Locks

Atomic Variables

Exploring the Date Class

Exploring the Formatter Class

Exploring the Random Class

Exploring the Scanner Class

Exploring the ZIP and JAR APIs

Exploring the ZIP API

Exploring the JAR API

Summary

images Chapter 11: Performing Classic I/O

Working with the File API

Working with the RandomAccessFile API

Working with Streams

Stream Classes Overview

OutputStream and InputStream

ByteArrayOutputStream and ByteArrayInputStream

FileOutputStream and FileInputStream

PipedOutputStream and PipedInputStream

FilterOutputStream and FilterInputStream

BufferedOutputStream and BufferedInputStream

DataOutputStream and DataInputStream

Object Serialization and Deserialization

PrintStream

Working with Writers and Readers

Writer and Reader Classes Overview

Writer and Reader

OutputStreamWriter and InputStreamReader

FileWriter and FileReader

Summary

images Chapter 12: Accessing Networks

Accessing Networks via Sockets

Socket Addresses

Socket Options

Socket and ServerSocket

DatagramSocket and MulticastSocket

Accessing Networks via URLs

URL and URLConnection

URLEncoder and URLDecoder

Accessing Network Interfaces and Interface Addresses

Managing Cookies

Summary

images Chapter 13: Migrating to New I/O

Working with Buffers

Buffer and Its Children

Buffers in Depth

Working with Channels

Channel and Its Children

Channels in Depth

Working With Regular Expressions

Pattern, PatternSyntaxException, and Matcher

Character Classes

Capturing Groups

Boundary Matchers and Zero-Length Matches

Quantifiers

Practical Regular Expressions

Summary

images Chapter 14: Accessing Databases

Introducing Java DB

Java DB Installation and Configuration

Java DB Demos

Java DB Command-Line Tools

Introducing SQLite

Accessing Databases via JDBC

Data Sources, Drivers, and Connections

Exceptions

Statements

Metadata

Summary

images Appendix A: Solutions to Exercises

Chapter 1: Getting Started with Java

Chapter 2: Learning Language Fundamentals

Chapter 3: Discovering Classes and Objects

Chapter 4: Discovering Inheritance, Polymorphism, and Interfaces

Chapter 5: Mastering Advanced Language Features Part 1

Chapter 6: Mastering Advanced Language Features Part 2

Chapter 7: Exploring the Basic APIs Part 1

Chapter 8: Exploring the Basic APIs Part 2

Chapter 9: Exploring the Collections Framework

Chapter 10: Exploring Additional Utility APIs

Chapter 11: Performing Classic I/O

Chapter 12: Accessing Networks

Chapter 13: Migrating to New I/O

Chapter 14: Accessing Databases

images Appendix B: Four of a Kind

Understanding Four of a Kind

Modeling Four of a Kind in Pseudocode

Converting Pseudocode to Java Code

Compiling, Running, and Distributing FourOfAKind

Index

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

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