How to judge primes by java
This article introduces the relevant knowledge of "how to judge primes by java". In the operation of actual cases, many people will encounter such a dilemma. Then let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
The operating environment of this tutorial: windows7 system, java10 version, DELL G3 computer.
1. The method of judging primes: divide a number from 2 to sqrt (this number). If it can be divisible, it shows that the number is not a prime number, on the contrary, it is a prime number.
Sqrt refers to the square, its function is to improve the speed of operation, or not to use.
Public class sushu {public static void main (String [] args) {int count=0; for (int iTunes 101)