title: Java Random number but not zero
body: <pre><code>int num = 10;
  Random rand = new Random();
  int ran = rand.nextInt(num);
  if (ran==0){          
    ran= ran+1;
  }
  System.out.println("random : "+ran);  
  </code></pre>
  
  <p>This is what i have coded so far, is there a better way to do this? I feel that this is hard coding when random is 0, I added 1.</p>