title: Java random number generator not working
body: <p>My random number generator is not working and I don't understand it. I am new to android programming and I can not figure out this peace of code. I have tried it several ways and it does not work properly. Please help me out, I am new please do not flame me.</p>
  
  <p>Examples: of actual code production</p>
  
  <p>First Set of trees spawned
  1011010110</p>
  
  <p>Second set of trees spawned within same game
  100001111110011</p>
  
  <pre><code> import java.util.Random;
   import android.util.Log;
  
   public class Tree {
   public Tree(int addition) {
  
      spawn = (int)(Math.random() * 2);
   }
  </code></pre>
  
  <p>I have also have tried.</p>
  
  <pre><code>private Random random = new Random();
  public Tree(int addition) {
  
      int randomNum = random.nextInt(2);
      spawn = randomNum;
  }
  </code></pre>
  
  <p>Thanks for looking this over.</p>
  
  <p>Steve</p>