Reverse a Long String
SOURCE : StringReverseLong.javapublic 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); }}INPUTString 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

0 comments :
Post a Comment