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
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.
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.
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.