Quantcast
Viewing latest article 3
Browse Latest Browse All 6

Answer by Peter Lawrey for Collections.reverse method not reversing entry

If you have a collection of one, it is the same in reverse order as forward.

If you want to reverse the string representation of an integer, you can use StringBuilder to reverse the digits.

StringBuilder sb = new StringBuilder();sb.append(digits);sb.reverse();System.out.println("Your number in reverse order is: "+ sb);

Viewing latest article 3
Browse Latest Browse All 6

Trending Articles