reverse number in jave code example Example: how to reverse a number in java int rev= 0; while(num > 9) { rev= rev*10 + num%10; num/= 10; }