An Introduction to Java
Note: The modules have exercises interspersed between the
material. It is highly recommended that you do these
exercises before continuing on. Some of these appear to contain links
to solutions. Regrettably, no solutions will be provided (They are for in-class use
only).
- Module 1:
an introduction to Java
- Language features: an overview.
- The hype: what it is and what it is not.
- Getting started: writing, compiling and executing
helloworld.
- Scanning a more complex example.
- Module 2:
Elementary Java, part I
- Comments.
- Datatypes, variables, constants, initialization.
- Unicode, void,
strings.
- Assignment, expressions, operators.
- Control flow.
- Arrays.
- Also see syntax review in the Appendix.
- Module 3:
Elementary Java, part II
- Functions, return types, parameters.
- Function overloading, signatures.
- I/O, files.
- program modules, naming conventions, import statement.
- Module 4:
Java objects, part I: static objects and encapsulation
- Class definition, static data and functions,
encapsulation, constants.
- Source files, visibility.
- Inheritance, function overriding.
- Module 5:
Java objects, part II: dynamism
- Class instances, instance variables and methods.
- Inheritance, function overriding, polymorphism,
casting.
- Objects as return values, references, this
- Constructors.
- Constructor chaining.
- Module 6:
Data structures in Java
- Linked lists without pointers.
- Enumeration objects.
- Dynamic multidimensional arrays.
- Pre-packaged structures: vectors, hashtables,
bitsets.
- Additional data structures, time-permitting.
- Module 7:
Java objects, part III: advanced topics
- Interfaces, abstract classes, multiple interfaces.
- static initializers.
- Finalizers,
shadowed variables and methods, visibility.
- Module 8:
The Java library: a quick peek
- Overview, examples of static and dynamic objects.
- Math, BigInteger, Date,
formatting, I/O.
- How not to get confused by the library documentation.
- Module 9:
AWT, part I
- Elementary drawing.
- Frames, canvases and panels.
- The Java 1.1 event model.
- A simple button.
- Handling mouse clicks.
- A simple applet.
- Module 9B:
Swing, part I
- Elementary drawing in Swing.
- Swing versions of Module 9 examples.
- Module 10:
Java objects, part IV: inner classes
- Inner classes, member classes, anonymous classes.
- How to implement event listener callbacks.
- Module 11:
Swing, part II
- Components and containers.
- Creating user interfaces: buttons, menus, checkboxes
etc.
- Layout managers.
- File dialogs, focus, pop-up menus.
- Building an application.
-
Module 12: Threads
- Running multiple threads.
- Synchronization, monitors.
- Communication.
- Module 13:
IO and Networking
- IO overview, TCP/IP.
- Learning to use IO streams.
- Pipes, Object serialization
- Networking overview, TCP/IP.
- Client/server programming via sockets.
- URL's and http.
- Applets and communication.
-
Module 14:
Native methods and JDBC
- How to call a C function from Java.
- JDBC.
- JDBC and Oracle
- Module 15:
Exceptions
(Not available at this time)
- Handling exceptions: the try
statement.
- Declaring exceptions, passing the buck.
- Creating exception objects.
-
Appendix: Various topics
-
Java Syntax Review and Exercises
-
Random Number Generation
-
Stepwise Refinement
-
Additional Practice Exercises
-
Answers to some frequently-asked questions
-
The Java API documentation (at SUN)