Can anyone please answer the below questions?
Can I use logical operator over enum values? For example:
enum Days { MONDAY(1), TUESDAY(2), WEDNESDAY(3), THURSDAY(4), FRIDAY(5), SATURDAY(6), SUNDAY(7) }now can I use
if(Days.SUNDAY > Days.MONDAY)....?Is there any process to specify a range of values for enum? For example, I want to specify the valid numbers for an exam should be between 1 - 100. So if I want to declare an enum, then it would be like this ->
enum Validno{ONE(1),TWO(2),....,HUNDRED(100)}Now is there any option to declare an enum containing the each values and specify them like a range instead of declaring each one seperately?- Thanks in advance.
ONE(1), TWO(2), ... HUNDRED(100)without actually typing it all in to your source code?