You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -140,9 +142,9 @@ This allows for comparing instances of enums as well as sorting or searching.
140
142
```java
141
143
publicvoid compareDayOfWeek(DayOfWeek dayOfWeek){
142
144
int comparison = dayOfWeek.compareTo(DayOfWeek.WEDNESDAY);
143
-
if (comparison <0) {
145
+
if (comparison <0) {
144
146
System.out.println("It's before the middle of the work week.");
145
-
} elseif(comparison >0){
147
+
} elseif(comparison >0){
146
148
System.out.println("It's after the middle of the work week.");
147
149
} else {
148
150
System.out.println("It's the middle of the work week.");
@@ -210,6 +212,6 @@ and reading these configuration files in the program in cases like this.
210
212
<aid="conclusion"> </a>
211
213
## Conclusion
212
214
213
-
Enums provide a simple and safe way of representing a fixed set of constants while keeping most of the flexibilities of classes. They are a special type of class that can be used to write code that is elegant, readable, and maintainable, and work well with other newer modern features like [Switch Expressions](id:lang.basics.switch_expressions). Another special class is the Record class introduced in Java 19. Visit our [Records tutorial](id:lang.records) to learn more.
215
+
Enums provide a simple and safe way of representing a fixed set of constants while keeping most of the flexibilities of classes. They are a special type of class that can be used to write code that is elegant, readable, maintainable and works well with other modern Java features like [switch expressions](id:lang.classes-objects.switch-expression). Another special class is the Record class introduced in Java 19. Visit our [records tutorial](id:lang.records) to learn more.
214
216
215
217
To learn more about enums, visit the [`java.lang.Enum`](javadoc:Enum) javadoc.
0 commit comments