Amazon interview question

Write a Java program to reverse a number