I'm doing some code for school, the exercise is: to do the Caesar cipher. The code:
char temp = 'u';
int key = 14;
int tempInt = ((int) temp) + key;
temp = (char) tempInt;
The temp should be 132 (ASCII) but java gives me '?'. How can I resolve this problem? I think that Java is working in Unicode... but I don't know how to do my exercise with adding the key value to the text (Caesar cipher).
tempIntshould contain the value you're after,tempcontains a char which has the value oftempInt. - Mark