0
Can we use for loop with enum in order to traverse constants?
2 Answers
0
try this:
enum Animals {
TIGER, CAT, LION
}
public class Test {
for (Animals a : Animals.values (){
System.out.println (a);
}
}
0
this code won't work...what is Animals.value?