User Tools

Site Tools


java_primer

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
java_primer [2020/08/23 17:14] – [NOTES] jrsetijava_primer [2020/11/19 17:19] (current) – [LinkedHashMap] jrseti
Line 20: Line 20:
  
 ====LinkedHashMap==== ====LinkedHashMap====
 +
 +**An OrderedDict!**
  
 Same as hashMap but preserves **insertion order**. O(1) insertion and lookup. Same as hashMap but preserves **insertion order**. O(1) insertion and lookup.
Line 171: Line 173:
  
   * a / b = Math.exp(Math.log(a) - Math.log(b))   * a / b = Math.exp(Math.log(a) - Math.log(b))
 +
 +====Random====
 +
 +<code>
 +//Random number from 0 to 5
 +Random rand = new Random(); 
 +int r = rand.nextInt(6); 
 +</code>
 +
 +or
 +
 +<code>
 +//Number between 0.0 and 1.0;
 +Math.random(); 
 +</code>
 +
java_primer.1598202856.txt.gz · Last modified: 2020/08/23 17:14 by jrseti