You do understand the common fact that zero is not same in integer form, and character form. Their binary, that gets generated and checked up against is not same. A character is a switch-able value, but it will not map any true value for the cases that you are using it for.
To solve this problem, change one of the types to other one,
for (i = 0; i < 5; i++) {
System.out.println((int)i);
switch (i++) {
case 0:
Otherwise, you should consider using character values, and use
Character.valueOf(i);
and then move onwards. That would look something like this,
for (i = 0; i < 5; i++) {
char ch = Character.valueOf(i);
System.out.println(i);
switch (ch++) {
case '0':
Doing the
ch++
is legal in Java, because a character is a numeric value that represents the Unicode character. Incrementing it, provides you with the next character and so on. If that doesn't sound easy, read about pointer arithmetic.