title: Generate random number based on time
body: <p>I tried to generate a random number with this code based on time :</p>
  
  <pre><code>  public class RandomInt {
       private Random generator = new Random(System.currentTimeMillis());
       double randomGenerator(){
           return generator.nextDouble()*0.5;
  
       }
       public static void main(String[] args) {
           new RandomInt();
       }
   }   
  </code></pre>
  
  <p>But when I run the java class, it shows nothing. Help me with this please. Thank you</p>
  
  <p>PS : I'm newbie   </p>