Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: minor

...

Code Block
bgColor#ccccff
import java.util.Random;
// ...

Random number = new Random(); // only used for demo purposes
int n;
//...
for (int i = 0; i < i<2020; i++) {
  // Re-seed generator
  number = new Random();
  // Generate another random integer in the range [0, 20]
  n = number.nextInt(21);
  System.out.println(n);
}

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="0e92d34427e26d4f-17c47418-437e4a1a-a8dd8eb5-f8e2269f689c7393c3dfc43f"><ac:plain-text-body><![CDATA[

[[API 2006

https://www.securecoding.cert.org/confluence/display/java/AA.+Java+References#AA.JavaReferences-API06]] 

[Class Random

http://java.sun.com/javase/6/docs/api/java/util/Random.html]

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="37d92c83e2beb819-c332f98c-495e4214-a8c99dc8-7fa248d5b6e8f2ec1180e74c"><ac:plain-text-body><![CDATA[

[[API 2006

https://www.securecoding.cert.org/confluence/display/java/AA.+Java+References#AA.JavaReferences-API06]]

[Class SecureRandom

http://java.sun.com/javase/6/docs/api/java/security/SecureRandom.html]

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="030ef9219ead5751-ba08914f-4dbb4cd3-b0d181fa-b9af8a6b5130e046e753c771"><ac:plain-text-body><![CDATA[

[[Find Bugs 2008

https://www.securecoding.cert.org/confluence/display/java/AA.+Java+References#AA.JavaReferences-FindBugs08]]

BC: Random objects created and used only once

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="217c1f21c63f1bb4-9a703913-405746bf-9c478c12-a60492401fc6e1cae319a7dd"><ac:plain-text-body><![CDATA[

[[Monsch 2006

AA. Bibliography#Monsch 06]]

 

]]></ac:plain-text-body></ac:structured-macro>

...