MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / main

Method main

control/RandomBounds.java:10–29  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

8
9public class RandomBounds {
10 public static void main(String[] args) {
11 new TimedAbort(3);
12 switch(args.length == 0 ? "" : args[0]) {
13 case "lower":
14 while(Math.random() != 0.0)
15 ; // Keep trying
16 System.out.println("Produced 0.0!");
17 break;
18 case "upper":
19 while(Math.random() != 1.0)
20 ; // Keep trying
21 System.out.println("Produced 1.0!");
22 break;
23 default:
24 System.out.println("Usage:");
25 System.out.println("\tRandomBounds lower");
26 System.out.println("\tRandomBounds upper");
27 System.exit(1);
28 }
29 }
30}

Callers

nothing calls this directly

Calls 1

randomMethod · 0.45

Tested by

no test coverage detected