Is there an analogous form of the following code:
if(month == 4,6,9,11)
{
do something;
}
Or must it be:
if(month == 4 ||
A rather literal translation into Java would be:
if (Arrays.binarySearch(new int[] { 4, 6, 9, 11 }, month) >= 0) {
I don't know what is so special about 4, 6, 9 and 11. You are probably better off using an enum, together with EnumSet or perhaps a method on the enum. OTOH, perhaps JodaTime does something useful.