[java/en] Enum Type

Outputs in line.
This commit is contained in:
Raphael Nascimento 2015-10-15 15:59:22 -03:00
parent 50a0bbf33f
commit 5a8a68988b

View File

@ -719,16 +719,12 @@ public class EnumTest {
public static void main(String[] args) { public static void main(String[] args) {
EnumTest firstDay = new EnumTest(Day.MONDAY); EnumTest firstDay = new EnumTest(Day.MONDAY);
firstDay.tellItLikeItIs(); firstDay.tellItLikeItIs(); // => Mondays are bad.
EnumTest thirdDay = new EnumTest(Day.WEDNESDAY); EnumTest thirdDay = new EnumTest(Day.WEDNESDAY);
thirdDay.tellItLikeItIs(); thirdDay.tellItLikeItIs(); // => Midweek days are so-so.
} }
} }
// The output is:
// Mondays are bad.
// Midweek days are so-so.
// Enum types are much more powerful than we show above. // Enum types are much more powerful than we show above.
// The enum body can include methods and other fields. // The enum body can include methods and other fields.
// You can se more at https://docs.oracle.com/javase/tutorial/java/javaOO/enum.html // You can se more at https://docs.oracle.com/javase/tutorial/java/javaOO/enum.html