How to convert a string to character in Java