I experimented a little with enums and arrays in Java:
enum animals
{CAT, DOG, COW, BIRD, POTATO}
To get this into an array I simply do this...
animals[] creatures = {animals.CAT, animals.POTATO};
But now if I have to define bigger entries, I thought it would be useful if I can just type in the enumeration without animals.XXX, like I also do in C++
animals[] creatures = {CAT, POTATO, BIRD, CAT, CAT, POTATO, COW...}
- It would take time and gives me a better overview
- Java already knows that my target type is 'animals', so in my opinion this is unnecessary (?)
So I just wondered if this is possible in any way, and why if not?