-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenumsand.java
More file actions
34 lines (28 loc) · 770 Bytes
/
enumsand.java
File metadata and controls
34 lines (28 loc) · 770 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
enum Status {
loading,
error,
saved
}
public class enumsand {
public static void main(String[] args) {
// Status[] ss = Status.values();
Status s = Status.loading;
switch (s) {
case loading:
System.out.println("Done loading data...");
break;
case error:
System.out.println("error occurred...");
break;
case saved:
System.out.println("Saved successfully");
break;
default:
System.out.println("InValid Data");
break;
}
// for (Status status : ss) {
// System.out.println(status + " " + status.ordinal());
// }
}
}