Added simple Java algorithm.

Alg06 ported to Java