- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSecureRandomClass.java
More file actions
Latest commit
23 lines (16 loc) · 730 Bytes
/
Copy pathSecureRandomClass.java
File metadata and controls
23 lines (16 loc) · 730 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
importjava.security.SecureRandom;
publicclassSecureRandomClass{
publicstaticvoidmain (String[] args) {
SecureRandomsecureRandom = newSecureRandom();
booleanoption = secureRandom.nextBoolean();
System.out.printf("Do you love java? %b%n",option);
intinteger = secureRandom.nextInt();
System.out.printf("The generated integer is %d%n",integer);
intintegerwithbound = secureRandom.nextInt(70000);
System.out.printf("The generated integer is %d%n",integerwithbound);
longnumber = secureRandom.nextLong();
System.out.printf("The generatedinteger is %d%n",number);
longnumber2 = secureRandom.nextLong(900_000_000_000L);
System.out.printf("The generatedinteger is %d%n",number2);
}
}