In Java 12 and later versions, the ________ expression can be used as an alternative to the traditional switch statement, providing a more concise and readable format.

  • for-each
  • lambda
  • switch
  • ternary
In Java 12 and later, you can use the "lambda" expression as an alternative to the traditional switch statement. This feature is also known as "switch expressions." It provides a more concise and readable way to handle multiple cases within a single expression.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *