And again, this JavaRanch forum is for discussing JavaRanch itself. We've got other forums for discussing Java programming and other topics. This one is for beginning Java questions; I'll move this post there for you.

Can you be more specific? In particular, do you need to generate prime numbers or do you need to determine if a given number is prime. One simple approach to the former is

(Note this is pseudocode so it will not compile in Java directly.)

This relies on determining that a given number is prime. I'll leave this to you to figure out with some hints:

1) What does it mean for a number to be prime? 2) How can you determine if a number is NOT prime?

If you can come up with answers to these two questions, that would be a good starting place. Feel free to discuss your ideas here and we will be glad to help out.