|
|
|
![]() |
![]() |
![]() |
![]() |
IBM developerWorks : Java : Education - Tutorials![]() | ![]() ![]() ![]() ![]() |
![]() |
![]() | |||||
![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
![]() | ||||
Creating a SecureRandom object is easy; just use the following lines in your code: secureRandom = new SecureRandom(); secureRandom.nextInt(); The first line actually creates the SecureRandom. Creating a SecureRandom takes a lot of computation, and this computation may not be executed until it's actually used. By calling the nextInt() method here, we get the creation process going and ensure the delay will happen at the start of the program, not later when it might inconvenience us. |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
![]() |
|
|