Illustration einer tropischen Insel mit Palmen und einem hohen Berg

Java Blog für Programmierer

Konstante case-Labels mit Bedingungsausdruck

· Christian Ullenboom

I wasn't aware that CaseConstant is a ConditionalExpression. So this is valid: final int a = 12; final int b = 13; switch ( 12 ) { case a > b ? a : b -> System.out.println( "a" ); }

Kategorien: Java News

← Alle Beiträge