BE-104 Handouts


My Java Reference Documents

* Java Language Quick Reference
* Selected Java Standard Classes Quick Reference
* Designing with Classes and Class Template Document
* Pseudocode and Flowchart Reference
* Numeric Format Specifiers
* Date/Time Format Specifiers
* Javadoc Notes
* File Input and Output (I/O) Notes
* My Java Documentation Requirements

 

Java Examples

File(s) Description Topic(s)
Die.java & DieTest.java Die Class Design Example OO design & documentation, simple random number generation & use and GUI I/O.
Arm.java & Main.java Arm Class Design Example OO design & documentation, biomechanics example and console I/O.
WeightConverter.java & Main.java

Weight Converter Class Design Example

OO design & documentation, GUI I/O and Decimal Format class.
BetterTime.java

Improved Elapsed Time Class

OO design & documentation, the system.nanoTime() method, console I/O (using of Scanner class for input & PrintStream. printf() method for formatted output).
RanTest.java Random Number Generator Demonstration The Random class, selection (if) and repetition (for) statements, arrays, file I/O using Formatter class.
ObjParms.java Object Parameter & Javadoc Example Implications of Java's parameter passing and return behaviors with respect to primitive and object data. Also, javadoc style comments. A bit over-the-top, but very complete.
RainFall.java Array Usage and File I/O Example The Scanner class for file input, the Formatter class for file output and storing information in arrays.

Comments regarding these examples: Improved versions of the early examples would involve putting the test/demo code main() method in a non-public class in the same file as the class of interest; replacing the use of the DecimalFormat class with the String.format() and/or PrintStream.format() methods; replacing the use of the Math.random() method with the Random class; replace the use of the PrintStream.printf() method (old, C++ style name) with PrintStream.format() (new, Java style name).

 

Other Stuff that Might be Useful

* Two Formatter Classes Handout

Send comments and suggestions about this course to: Charles S. Tritt, Ph.D.
This page last updated 5/19/05