How would one use java to find the next greatest prime number based on a long using only primitive data types, and static methods of the math class?

Thank you.

Printable View

- 11-16-2012, 04:53 PMbam207Find a prime number
How would one use java to find the next greatest prime number based on a long using only primitive data types, and static methods of the math class?

Thank you. - 11-16-2012, 06:40 PMJingoismRe: Find a prime number
Why don't you give it a try, and if you have issues with the implementation then you can come back here and ask more specific questions that we can then answer.

- 11-16-2012, 06:42 PMdoWhileRe: Find a prime number
How would you do this with a pen and paper? You first need to have an algorithm before you think about data types and static methods...write out how you would do this by hand in a stepwise process - that's your algorithm. Once you have that you will be much better suited to think about how to write code to implement the algorithm.