Write code to do int Reverse
//package com.book2s; public class Main { public static void main(String[] argv) { int num = 42; System.out.println(intReverse(num)); }/*w w w .j a v a2s .c o m*/ public static int intReverse(int num) { char[] reversed = ("" + num).toCharArray(); String reversedInt = ""; for (int i = reversed.length - 1; i >= 0; i--) { reversedInt += reversed[i]; } return Integer.parseInt(reversedInt); } }