Table of Contents
why you should learn Java
object-oriented programming languages
Java's network-oriented features
programming idioms
compiling and executing
class and method definitions
the display statement and strings
case sensitivity and blank insensitivity
operators and operands
the main
method
integral and floating-point data types
variable declarations, initialization, and assignment
short and long comments
arithmetic expressions
precedence and association
binary and unary operators
type casting
calling and returning from methods
arguments, parameters, and values
method overloading in multiple classes
method overloading in one class
parameters and local variables
local scope and dynamic extent
blocks
making programs easier to reuse, read, and debug
making programs easier to augment, improve, and adapt
class variables
final variables
instance creation
instance variables
defining instance methods
the target argument
the this
parameter
constructors and initialization
the default constructor
constructors with parameters
getter and setter instance methods
imaginary instance variables
access methods and data abstraction
making programs easier to reuse
subclasses and superclasses
instance-variable and instance-method inheritance
drawing a class-hierarchy diagram
superclass constructor evaluation
shadowing, also known as overriding
private instance variables and instance methods
enforcing data abstraction
public instance variable and methods
private instance variable and methods
protected instance variable and methods
the public interface
using this
to call a constructor
using super
to call a constructor
implicit method targets
the this
parameter as a method target
the super
parameter as a method target
explicit representation
the no-duplication principle
the look-it-up principle
the need-to-know principle
the is-a versus has-a principle
abstract classes and abstract methods
imposing method-definition requirements with abstract classes
classes without instances
classes without subclasses
defining interfaces
imposing method-definition requirements with interfaces
interfaces as documentation centers
interfaces as an alternative to multiple inheritance
predicates and Boolean values
equal, ==
, and not equal, !=
greater than, >
, and less than, <
not, !
casting before testing
Boolean expressions
if
and if--else
statements
empty statements
the conditional operator, ?:
and, &&
, and or, ||
evaluation order
while
and for
statements
augmented assignment operators
increment, ++
, and decrement, --
, operators
side effects and evaluation order
recursive methods
the base part and the recursive part
efficiency considerations
switch
statements
case
and default
fall through
creating file input streams
creating input-stream readers
creating tokenizers
stepping, testing, and reading from tokenizers
declaring and initializing arrays
arrays of numeric elements
arrays of class-instance elements
arrays of mixed instance types
using arrays as arguments
returning arrays from methods
storing and retrieving elements in vectors
obtaining the size of a vector
queues and push-down lists
casting vector elements prior to use
vector iteration and iterators
wrappers
characters and strings
extracting characters from strings
using characters in switch
statements
exception handling
the try
statement
catch
and finally
blocks
exit
statements
creating file output streams
creating output-stream print writers
printing to print writers
reading and writing serialized files
using the Serializable
interface to instruct the compiler
modularity
grouping classes into modular compilation units
grouping classes into modular packages
package names and path names
private package and compilation unit access
protected package and compilation unit access
public package and compilation unit access
unmarked package and compilation unit access
graphical user interfaces
components, containers, and windows
events and listeners
inner classes
nameless inner classes
application structure
graphics contexts
drawing lines
content panes
writing text
fonts and font metrics
the Observable
class
the Observer
interface
notifying and updating
accessing applications from observers and listeners
accessing application variables from observers and listeners
applets and the JApplet
class
the role of applets in browsers
init
, start
, stop
, and destroy
methods
testing applets
formatting tags
embedding applets in HTML files
locating HTML files with URL addresses
accessing text and image files
the Class
class
location-independent resource access
security features
adding elements to choice lists
determining which element has been selected
drawing images
scaling images
apparently simultaneous computation
processes and multithreading
starting and stopping threads
putting a thread to sleep
labels, text fields, and buttons
using the grid layout
property-change events and listeners
menu bars, menus, and menu items
popup menus and menu items
how layout managers do their work
laying out containers without a layout manager
defining new layout managers
tables and table models
using renderers to change appearance
row selection and cell editing
clients and servers
calling methods to be run on servers
compiling remotely accessible classes
link-activated servlets
form-activated servlets
servlet-generated HTML pages
cookies
creating JAR files
running applications from JAR files
manifest files