CIS 67: Some Simple Java Programs
The
psJava console package
from Koffman-Woltz and a
simple program to test it
.
The Hello program:
using System.out
,
using System.in and System.out
,
using javax.swing.JOptionPane output
,
using javax.swing.JOptionPane input output
,
using the Koffman-Woltz psJava package
The
euclidean algorithm
to compute the gcd of two integers
Printing n
Fibonacci numbers
Overflow and roundoff
errors
.
Printing the
integer values of the printable ASCII characters
An
example
that shows a usage of a command line parameter and of the substring method for Strings. It prints proper heads and tails of a string.
A simple
example
of use of the Tokenizer class.
Generating a
random permutation
.
A large supply of examples of Java code, some for advanced applications, is at
http://developer.java.sun.com/developer/codesamples/
Many more examples are in
The Java Developers Almanac 1.4>