Converting between integers and characters, simply by casting, is rather dodgy, unless you are really sure that your integer can only represent a character in the 7-bit ASCII set. Might your application ever be internationalised? If so,
you should seek a better approach.
Also, converting between upper and lower case by adding 32 to the integer value is bad, for similar reasons. Use Character.toLowerCase() and Character.toUpperCase(). These work correctly for international characters. They are also clearer to the reader of your code.