Java: First Contact
Roger Garside and John Mariani, Computing Department, Lancaster University
Course Technology /
September 1997 /
ISBN 1-85032-316-X
46.65 US dollars /
21.95 pounds sterling
Outline
Part One: Using Objects
Chapter 1: Programming and the Java Language
Programs and programming;
an introduction to algorithms;
expressing programs in high-level languages;
an introduction to the hardware of a simple computer;
an introduction to machine code (optional);
an introduction to files and the filing system;
an introduction to the World Wide Web;
a brief history of Java and how applets are used over the Web;
getting started with Java;
a first "Hello, World" Java program;
some discussion of output methods;
how the book is arranged
Chapter 2: Object-Orientation
The concepts of objects and classes in the real world;
objects and methods in programming,
and how they impact on software engineering issues;
types;
classes and instances
Chapter 3: Declaring Objects and Calling Methods
A simple program to set up an object variable,
and use constructor, mutator, selector and other methods,
and constants - using a "Person" class [provided],
and referring to on-line documentation for each method, etc.;
packages and import visited.
Chapter 4: Selecting Among Alternatives
Reading values from the keyboard (using a "BasicIo" class [provided]),
with an introduction to the int and String types;
an introduction to decisions in programming,
and how they are implemented in Java - the if and switch statements;
relational and logical operators,
the boolean type and Boolean expressions;
a simple test harness for a class
Chapter 5: Repetition
Repetition in the real world, and in programming -
simple forms of the for loop;
the while loop;
break for exit from the middle of a loop;
ested loops;
Boolean expressions for loops;
do-while, etc.
Chapter 6: Basic Java Data Types
the contrast between basic and object types in Java;
int;
the byte, short and long typews (optional);
floating-point types;
boolean;
char;
Strings and String methods;
wrapper classes (optional)
Part Two: Writing Objects
Chapter 7: A Simple Class
the overall structure of the "Person" class -
how to write the instance variables and methods;
actual and formal parameters - parameter passing for the basic data types;
return values;
naming conventions for classes, methods, etc.
Chapter 8: More on the Simple Class
Constructor methods and overloading;
class constants;
class variables (optional);
private methods;
static (class) methods;
packages and directories;
the import statement revisited;
scope and visibility;
the "this" keyword
Chapter 9: Arrays
collections of basic elements (e.g. ints) or objects (e.g. Persons) as arrays;
searching an array - binary search;
simple ideas of sorting an array;
arrays as arguments;
multi-dimensional arrays;
non-rectangular arrays (optional)
Chapter 10: Objects within Objects
the idea of objects containing other objects;
an "OurDate" class [provided], and its use in the "Person" class;
objects as parameters - deep and shallow copies;
parameter passing for object types;
hiding references to other objects
Chapter 11: Putting Objects to Work
a "Task Organiser" problem and a "PriorityQueue" class [provided];
implementing the priority queue with arrays - alternative strategies;
testing and using the PriorityQueue class;
comments on issues to be addressed later in the book
Part Three: Advanced Objects
Chapter 12: An Introduction to Inheritance
real-world examples of inheritance;
inheritance in software terms;
the motivation for inheritance;
overriding inherited methods;
access rights and subclasses;
an airline reservation example of the use of inheritance
Chapter 13: Class and Method Polymorphism
Constructor methods and inheritance;
the inheritance hierarchy, the "Object" class, and the "toString" method;
polymorphism and heterogeneous collections;
calling overridden methods and the "super" keyword.
Chapter 14: Abstract Classes and Interfaces
motivation and examples of abstract classes;
motivation and examples of interfaces in Java
Chapter 15: Throwing and Catching Exceptions
motivation for exceptions;
defining a new exception using inheritance;
throwing an exception;
catching an exception - try, catch, and finally
Chapter 16: Graphics and the Abstract Window Toolkit (AWT)
Introduction to graphical interfaces;
a simple "smiley" face AWT program,
with some buttons - Frames, layout managers, Panels, Labels, Buttons, etc.;
drawing pictures and writing text with the Canvas class;
input of text strings;
a discussion of menus, file dialogues and images (optional)
Part Four: Advanced Java
Chapter 17: Linked Data Structures
Linked data structures, and their implementation in Java;
re-implementation of the PriorityQueue class
(see Chapter 11) using a linked list;
discussion (optional) of deletion from a linked list, doubly-linked lists
Chapter 18: Recursion and Binary Trees
How recursion works;
examples of recursive and iterative algorithms;
implementation of binary search trees using dynamic structures
Chapter 19: Input and Output in Java
an introduction to different types of input/output;
Java classes for input and output;
System.out and System.err;
System.in and the StringTokeniser class;
files and file handling;
reading and writing sequential text files;
introduction (optional) to binary and random access files;
introduction (optional) to simple communication with a remote computer
Chapter 20: Creating and Using Applets
Creating applets;
HTML and using applets;
applet parameters, and applet methods;
a useful applet;
the security of applets
Chapter 21: Other Features of Java
Vectors and Hashtables;
StringBuffers;
accessing type information at run-time;
an introduction to multi-threading in Java
Part Five: Object-Oriented Design
Chapter 22: Object-Oriented Design
the software crisis of the 1960's
and the advent of software engineering as the solution;
the software life cycle in the context of the design process;
functional design and object-oriented design;
a graphical notation for capturing a design;
an example - a telephone directory manager
as part of a larger personal organiser;
the process of object identification;
an initial high-level design
Chapter 23: Case Study - Implementing the Personal Organiser (1)
continuing the design process for the personal organiser -
moving towards detailed design by considering implementation options;
how to organise the telephone directory,
both in main memory and on the backing store;
an index sequential file structure, and
the organisation of the index file and main file;
consideration of Java's Vector and HashTable classes for main memory,
and use of the Vector as a server rather than a superclass;
the classes needed to implement the telephone directory manager;
coping with persistency
(how the instances will be saved on the backing store);
the final design and methods of each class
Chapter 24: Case Study - Implementing the Personal Organiser (2)
a prototype implementation;
the source code for each of the classes;
a text-based driver application to allow testing of the classes;
an initialisation application using Java's StringTokenizer class;
a GUI version of the prototype;
possible uses of inheritance in the design
Chapter 25: Criteria for a Good Object Oriented Design
criteria for assessing an object oriented design;
the extensibility of the design
of the telephone directory manager and the personal organiser framework.
Appendices
Appendix A: Getting started with Java - useful Web sites
Appendix B: Java version 1.0.2
Appendix C: A list of Java keywords
Appendix D: A list of basic Java characters
Appendix E: Sample Program Listings
Return to main page
last updated: 29th January 1998