switch (val) { case VAL: { // This will work int newVal = 42; break; } case ANOTHER_VAL: ... break; }