Add Java version of question 5 with print functionality.

Multiplication is missing a loop.