Reverse a Long String

Reverse a Long String
SOURCE : StringReverseLong.java

public class StringReverseLong {

public static void main(String[] args) {

String s = "INDAIA is my country and all its class and its effective manner";
StringBuffer sb = new StringBuffer();
for (int i = (s.length() - 1); i != 0; i--) {

sb.append(s.charAt(i));
}
System.out.println(sb);

}

}


INPUT

String s = "INDAIA is my country and all its class and its effective manner"



OUTPUT

rennam evitceffe sti dna ssalc sti lla dna yrtnuoc ym si AIADN







Sandeep Kumar D

Hi, I have written and developed this post so that most of people will be benefited. I'm committed to provide easy and in-depth tutorials on various technologies.I hope it will help you a lot.

- Sandeep Kumar D

Follow Me @Google+




SHARE

    Blogger Comment
    Facebook Comment

0 comments :

Post a Comment