i have a progam to reverse simple string. It seems printing incorrect output and not the rev string.
public class RevString {
public static void main(String[] args) {
String test = "Th";
int lenght = test.length();
System.out.println(test.charAt(lenght-1)+test.charAt(lenght-2));
}
}
output --
220