dcsimg
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Java
Expertise: Intermediate
Feb 14, 2019

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


Boost the Switch Statement in JDK 12

Starting with JDK 12, the "switch" statement is extended so that it can be used as either a statement or an expression.

A sample:

switch (day) {
    case MONDAY, FRIDAY, TUESDAY, SUNDAY - System.out.println(...);
    case THURSDAY, SATURDAY              - System.out.println(...);
    case WEDNESDAY                       - System.out.println(...);
}
Octavia Anghel
 
Thanks for your registration, follow us on our social networks to keep up-to-date