
how to reverse any character of the string?

Hi,
You can easily reverse String with the help of StringBuffer class.
Read how to reverse an string using StringBuffer class at:
Thanks

Hi,
Here is another example of string:
class Str
{
public static void main(String args[]) throws Exception
{
String s1="naren";
int n=s1.length();
for(int i=n-1;i>=0;i--)
{
System.out.print(""+s1.charAt(i));
}
}
}
Thanks

Hi Friend,
Try the following code:
import java.util.*;
public class Reverse{
public static void main(String[]args){
Scanner input=new Scanner(System.in);
System.out.print("Enter String: ");
String st=input.nextLine();
char ch[]=st.toCharArray();
for(int i=ch.length-1;i>=0;i--){
System.out.print(ch[i]);
}
}
}
Thanks
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.