2021-09-20 17:33:35 -06:00
|
|
|
// housekeeping/ForTypeInference.java
|
|
|
|
// (c)2021 MindView LLC: see Copyright.txt
|
|
|
|
// We make no guarantees that this code is fit for any purpose.
|
|
|
|
// Visit http://OnJava8.com for more book information.
|
|
|
|
// {NewFeature} Since JDK 11
|
|
|
|
|
|
|
|
public class ForTypeInference {
|
|
|
|
public static void main(String[] args) {
|
|
|
|
for(var s : Spiciness.values())
|
|
|
|
System.out.println(s);
|
|
|
|
}
|
|
|
|
}
|
2021-11-07 17:48:46 -07:00
|
|
|
/* Output:
|
2021-09-20 17:33:35 -06:00
|
|
|
NOT
|
|
|
|
MILD
|
|
|
|
MEDIUM
|
|
|
|
HOT
|
|
|
|
FLAMING
|
|
|
|
*/
|