1public class ReverseString {
2 public static void main(String[] args) {
3 String s1 = "neelendra";
4 for(int i=s1.length()-1;i>=0;i--)
5 {
6 System.out.print(s1.charAt(i));
7 }
8 }
9}
1public class Main {
2
3 public static void main(String[] args) {
4 // Write a Java program to reverse a string.
5 Scanner input = new Scanner(System.in);
6 System.out.println("Enter the String:");
7 char[] letters = input.nextLine().toCharArray();
8 System.out.println(" Reverse String");
9 for(int i = letters.length -1; i >= 0; i--){
10 System.out.print(letters[i]);
11 }
12 }
13}
14