2016-12-04 09:30:08 -08:00
|
|
|
// enums/Burrito2.java
|
2021-01-31 15:42:31 -07:00
|
|
|
// (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.
|
2016-12-04 09:30:08 -08:00
|
|
|
// {java enums.Burrito2}
|
2015-06-15 17:47:35 -07:00
|
|
|
package enums;
|
2016-12-04 09:30:08 -08:00
|
|
|
import static enums.SpicinessEnum.*;
|
2015-06-15 17:47:35 -07:00
|
|
|
|
2016-12-04 09:30:08 -08:00
|
|
|
public class Burrito2 {
|
|
|
|
SpicinessEnum degree;
|
|
|
|
public Burrito2(SpicinessEnum degree) {
|
2016-01-25 18:05:55 -08:00
|
|
|
this.degree = degree;
|
|
|
|
}
|
2021-01-31 15:42:31 -07:00
|
|
|
@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) {
|
2016-12-04 09:30:08 -08:00
|
|
|
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
|
|
|
*/
|