Java examples added.

added some examples on prime finding, sorting, and the static factory practice.