OnJava8-Examples/housekeeping/ForTypeInference.java

20 lines
418 B
Java
Raw Normal View History

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);
}
}
/* Output:
2021-09-20 17:33:35 -06:00
NOT
MILD
MEDIUM
HOT
FLAMING
*/