string reverse in java using for loop code example
Example 1: string reverse in java
String str = "Hello";
String reverse(String str){
StringBuilder sb = new StringBuilder();
sb.append(str);
sb.reverse();
return sb.toString();
}
Example 2: java reverse loop
for (int i = aList.size() - 1; i >= 0; i--) {
String s = aList.get(i);
}