Link Details

Link 1094833 thumbnail
User 914719 avatar

By alwayzdere
Published: Jan 13 2014 / 05:35

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.
  • 11
  • 0
  • 816
  • 1423

Add your comment

Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Apache Hadoop
Written by: Piotr Krewski
Featured Refcardz: Top Refcardz:
  1. Play
  2. Akka
  3. Design Patterns
  4. OO JS
  5. Cont. Delivery
  1. Play
  2. Java Performance
  3. Akka
  4. REST
  5. Java