class Reverse { public static int reverseInt(int n) { StringBuffer str = new StringBuffer(""+n); str.reverse(); return Integer.parseInt(str.toString()); } public static void main(String[]args) { int n= 0; System.out.println(reverseInt(123)); }}