Quantcast
Viewing all articles
Browse latest Browse all 6

Answer by Rahman for Collections.reverse method not reversing entry

If you want to reverse a String why are you adding it to a list ?

Use this :

         String s = sc.next();         StringBuilder sb = new StringBuilder(s);         System.out.println(sb.reverse());

Viewing all articles
Browse latest Browse all 6

Trending Articles