Simple Prime Number Generator written in Java