Cognizant interview question

Write prime number program in Java