public class TestString8 {
public static void main(String args[]) {
String str = "abcdefadg";
System.out.println(test1(str));
}
public static String test1(String string) {
LinkedList<Character> link = new LinkedList<Character>();
char[] arr = string.toCharArray();
for (int i = 0; i < arr.length; i++) {
link.push(arr[i]);
}
StringBuilder sb = new StringBuilder();
int n = link.size();
for (int j = 0; j < n; j++) {
sb = sb.append(link.pop());
}
return sb.toString();
}
}
public static void main(String args[]) {
String str = "abcdefadg";
System.out.println(test1(str));
}
public static String test1(String string) {
LinkedList<Character> link = new LinkedList<Character>();
char[] arr = string.toCharArray();
for (int i = 0; i < arr.length; i++) {
link.push(arr[i]);
}
StringBuilder sb = new StringBuilder();
int n = link.size();
for (int j = 0; j < n; j++) {
sb = sb.append(link.pop());
}
return sb.toString();
}
}