The other answers contain a lot of needless text and code. Here are two ways to get the last character of a String:
char
char lastChar = myString.charAt(myString.length() - 1);
String
String lastChar = myString.substring(myString.length() - 1);