I think this should help.
import java.util.*;
public class StringSwap{
public static void main(String ar[]){
Scanner in = new Scanner(System.in);
String s = in.next();
System.out.println(new StringBuffer(s.substring(0,2)).reverse().toString().concat(s.substring(2)));
}
}