OnJava8-Examples/enums/Burrito2.java

28 lines
703 B
Java
Raw Permalink Normal View History

// enums/Burrito2.java
// (c)2021 MindView LLC: see Copyright.txt
2015-11-15 15:51:35 -08:00
// We make no guarantees that this code is fit for any purpose.
2016-09-23 13:23:35 -06:00
// Visit http://OnJava8.com for more book information.
// {java enums.Burrito2}
2015-06-15 17:47:35 -07:00
package enums;
import static enums.SpicinessEnum.*;
2015-06-15 17:47:35 -07:00
public class Burrito2 {
SpicinessEnum degree;
public Burrito2(SpicinessEnum degree) {
2016-01-25 18:05:55 -08:00
this.degree = degree;
}
@Override public String toString() {
2016-01-25 18:05:55 -08:00
return "Burrito is "+ degree;
}
2015-06-15 17:47:35 -07:00
public static void main(String[] args) {
System.out.println(new Burrito2(NOT));
System.out.println(new Burrito2(MEDIUM));
System.out.println(new Burrito2(HOT));
2015-06-15 17:47:35 -07:00
}
2015-09-07 11:44:36 -06:00
}
/* Output:
2015-06-15 17:47:35 -07:00
Burrito is NOT
Burrito is MEDIUM
Burrito is HOT
2015-09-07 11:44:36 -06:00
*/