+ 2

How to find the reverse of any number in java by looping method??

15th Aug 2017, 2:26 AM
Akshat Agarwal
Akshat Agarwal - avatar
3 Answers
+ 4
If you're lazy and performance doesn't matter, you can do this; System.out.println(new StringBuilder(String.valueOf(input)).reverse());
15th Aug 2017, 5:48 AM
Garikai
Garikai - avatar
+ 2
@Serena, Lol; oops, had forgotten that part 😅
15th Aug 2017, 6:11 AM
Garikai
Garikai - avatar
+ 1
what's the use of '//reversing' here?
21st Aug 2017, 11:23 AM
Akshat Agarwal
Akshat Agarwal - avatar