
how to reverse a string without changing its place

Hi Friend,
Try this:
import java.util.*;
public class ReverseString{
public static void main(String[]args){
Scanner input=new Scanner(System.in);
System.out.println("Enter string: ");
String str=input.nextLine();
String reverse = new StringBuffer(str).reverse().toString();
System.out.println("Reverse: " + reverse);
}
}
Thanks

I need flowcharts for sting and matrix operations....
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.