Infosys interview question

Write a program in java to determine if a number is prime or not.