int a = 1;

switch (a) {
    case 0:
        // do something
        break;
    case 1:
        // do something
        break;
    case 2:
        // do something
        break;
    default:
        // do something
}