boolean additionalVariable = false;
switch (variable) {
case 2:
if (someCondition()) {
additionalVariable = true;
System.out.println("Additional check is true for Case 2");
} else {
System.out.println("Additional check is false for Case 2");
}
default:
System.out.println("Default case");
}
System.out.println("Value of additionalVariable: " + additionalVariable);
}