We all know that switch statements are alternatives to nested if-else statements. But they are far more optimitized then a simple set of if-else statements. Still I won't say using switch statements will always give the most optimized code. There are a number of ways that can help you to write a better code than simply using switch/case statements. So now the question that arises is how is this feature implemented in Java SE 7. So it is nothing but the mixture of hashCode, equals() and the previous version of Switch statements. So in the below example I have used the technique that is used current implementation of this update.