Next:
Introduction
Up:
4days_dd
Previous:
UML
Contents
Day 2: The Java Programming Language
Subsections
Introduction
Chapter objectives
Java design goals
What is Java?
How/where to get Java
First Steps with Java
Java Commands and Utilities
A first application
main
Variables, constants, and keywords
Primitive data types
Literals
boolean
literals
char
literals
Floating-point
literals
String
literals
Constants
Reserved keywords
Arrays
Strings
String objects
StringBuffer
class
Exercise
Exercise
Comments and Javadoc
Types of comments
Javadoc comment tags
@see
@param
@return
@exception
@deprecated
@author
@version
@since
A comment example
Notes on Usage
Flow control and loops
Introduction
Objectives
Statements and blocks
Expressions that can be made into statements
Declaration statements
if-else
switch
while and do-while
for
Labels
break
continue
return
No
goto
Statement
Classes and objects
Introduction
Objectives
A Simple Class
Fields
Access Control and Inheritance
Creating Objects
Constructors
Constructor example
Methods
Parameter values
Using methods to control access
this
Overloading methods
Overriding methods
Static members
Initialization Blocks
Garbage collection and finalize
finalize
The
toString()
Method
Native Methods
Methods and parameters
Methods
Invoking a Method
The this Reference
Extending Classes
Introduction
Objectives
An extended class
A simple example
What protected really means
Constructors in extended classes
Constructor order dependencies
Constructor phases
Constructor phase example
Overriding methods, hiding fields, and nested classes
Overriding
The
super
keyword
Marking methods and classes
final
The
object
class
Object's utility methods
Anonymous classes
Abstract Classes and methods
Cloning objects
Three major considerations in writing a clone method
Four different attitudes a class can have towards clone
Extending classes: how and when
Designing a class to be extended
Bad effects of public fields
Non-final classes have two interfaces
Interfaces
Introduction
Objectives
An example interface
Nested classes and interfaces
Single inheritance versus multiple inheritance
Extending Interfaces
Name Conflicts
Implementing Interfaces
Using an Implementation
Marker Interfaces
When to Use Interfaces
Two Important Differences Between Interfaces and Abstract Classes
Interface or Abstract Class
Exceptions
Introduction
Objectives
Creating exception types
throw
The throws clause
Choices when invoking a method that has a throws clause
try, catch, and finally
finally
When to use exceptions
Packages
Introduction
Package Naming
Package Access
Package Contents
Examples
Next:
Introduction
Up:
4days_dd
Previous:
UML
Contents