[Solved] How do I reverse a number in java


You are mixing types. “025” is not an integer, it’s a String. In integer you simply cannot distinguish between 25, 025, 0025, 00025, … Implement your assignment as a String operation.

public String reverseString(String s) {
    // put your code here
}

You may find very useful the Oracle tutorial on Strings here: https://docs.oracle.com/javase/tutorial/java/data/strings.html

7

solved How do I reverse a number in java