In reversing an integer , I am using two duplicated while loops, is there any way to refactor those while loops and instead use one?

practice it answers edition 4
reverse a number in java using recursion
program to reverse a number in java
practice it answers bjp3 self-check
reverse number in java using do while loop
reverse number in java javatpoint
java program to reverse a number using array