I just want to convert an integer...say 8....to a char...which will be '8'.
This is really weird...when i use the debugger the value of e will be correct...other times it will be blank...is there another way to do this conversion?
Printable View
I just want to convert an integer...say 8....to a char...which will be '8'.
This is really weird...when i use the debugger the value of e will be correct...other times it will be blank...is there another way to do this conversion?
It should always be correct. Make sure you're at a point while debugging that e is indeed '5' (or whatever character you want).
Code Java:
Also, is your code taken from somewhere else? Perhaps the problem lies in where you're trying to use forDigit()?
I'm not going to throw my code up here...but I am re-initializing the same char variable multiple times.
The first time......e = Character.forDigit(z,10);....gets executed.....e is what it should be
The second time....e = Character.forDigit(z,10);.....gets executed....e simply becomes blank or ' '....doesn't make any sense...and this is the last part to finish the program.
I actually tried using another variable in replace of the second execution and it still doesnt work...it has me stumped.