public class ReverseString { public static void main(String[] args) { String s1="Strings are Immutable"; String strArr[]=s1.split(" "); String str1=strArr[0]; String str2=strArr[1]; String str3=strArr[2]; String strFinal=""; for (int i=str1.length()-1;i>=0;i--) { strFinal=strFinal+str1.charAt(i); } strFinal=strFinal+" "; for (int i=str2.length()-1;i>=0;i--) { strFinal=strFinal+str2.charAt(i); } strFinal=strFinal+" "; for (int i=str3.length()-1;i>=0;i--) { strFinal=strFinal+str3.charAt(i); } System.out.println(strFinal); } } | 0 |
By: [email protected] On: Wed Feb 22 10:34:14 IST 2017 0 0 0 | 0 |
Are You Satisfied :0Yes0No |
public class reverse { public static void main(String args[]) throws IOException { char[] testArray = new char[100]; Scanner in = new Scanner(System.in); System.out.println("Enter a string"); testArray = in.nextLine().toCharArray(); for(int i=(testArray.length-1);i>=0;i--) { System.out.print(testArray[i]); } } } | 0 |
By: [email protected] On: Wed Feb 22 13:27:39 IST 2017 0 0 0 | 0 |
Are You Satisfied :0Yes0No |
public class reverse { public static void main(String args[]) throws IOException { char[] testArray = new char[100]; Scanner in = new Scanner(System.in); System.out.println("Enter a string"); testArray = in.nextLine().toCharArray(); for(int i=(testArray.length-1);i>=0;i--) { System.out.print(testArray[i]); } } } | 0 |
By: [email protected] On: Wed Feb 22 13:31:54 IST 2017 0 0 0 | 0 |
Are You Satisfied :0Yes0No |