It should always be correct. Make sure you're at a point while debugging that e is indeed '5' (or whatever character you want).

int z = 5;
char e; // e is nothing

e = Character.forDigit(z,10);...