fork download
  1. import java.lang.Math;
  2.  
  3. class Gfg1 {
  4.  
  5. // driver code
  6. public static void main(String args[])
  7. {
  8. // Generate random number
  9. double rand = Math.random();
  10.  
  11. // Output is different everytime this code is executed
  12. System.out.println("Random Number:" + rand);
  13. }
  14. }
Success #stdin #stdout 0.1s 50672KB
stdin
Standard input is empty
stdout
Random Number:0.6369343919420918