2017-01-10 14:11:16 -08:00
|
|
|
// equalshashcode/Prediction.java
|
2021-01-31 15:42:31 -07:00
|
|
|
// (c)2021 MindView LLC: see Copyright.txt
|
2017-01-10 14:11:16 -08:00
|
|
|
// We make no guarantees that this code is fit for any purpose.
|
|
|
|
// Visit http://OnJava8.com for more book information.
|
|
|
|
// Predicting the weather
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
public class Prediction {
|
|
|
|
private static Random rand = new Random(47);
|
2021-01-31 15:42:31 -07:00
|
|
|
@Override public String toString() {
|
2017-01-10 14:11:16 -08:00
|
|
|
return rand.nextBoolean() ?
|
|
|
|
"Six more weeks of Winter!" : "Early Spring!";
|
|
|
|
}
|
|
|
|
}
|