A Java program for generating prime numbers