The program is as follows
//input: the int value that needs to be reversed.
public int reverse(int inputNum){.
String inputStr=""; //Convert the input integer to a string first.
String result=""; //Define the reversed string in advance.
//Loop.
for(int i=inputStr.length()-1;i>=0;i--){.
//Construct a new string by concatenating characters one by one.
result=result+inputStr.charAt(i);. }.
//The reversed string is converted to int and returned.
return Integer.parseInt(result). }.