public int reverseInteger2(int x) {
		boolean isNeg = false;
		
		if (x < 0) {
			isNeg = true;
			x = - x;
		}
		
		String str = Integer.toString(x);
		int len = str.length();
		char[] rev = new char[len];
		
		for (int i = 0; i < str.length(); i++) {
			rev[i] = str.charAt(len - 1);
			len --;
		}
		
		String str_rev = new String (rev);
		try {
			int result = Integer.parseInt(str_rev);
			return isNeg ? - result : result;
			
		} catch (NumberFormatException ex) {
			System.out.println(ex.getMessage());
			return -1;
		}
	}