Barclays interview question

Write java code to print prime numbers?