reverse string in java

import java.util.*;
import java.lang.*;
class Demo{
public static void main(String[] args){
String s = “brock”;
StringBuilder sb = new StringBuilder(s);
sb.reverse();
System.out.println(sb.toString());
}
}


This content originally appeared on DEV Community and was authored by NJ


import java.util.*;
import java.lang.*;
class Demo{
    public static void main(String[] args){
        String s = "brock";
        StringBuilder sb = new StringBuilder(s);
        sb.reverse();
        System.out.println(sb.toString());
    }
}


This content originally appeared on DEV Community and was authored by NJ


Print Share Comment Cite Upload Translate Updates
APA

NJ | Sciencx (2023-05-14T10:10:57+00:00) reverse string in java. Retrieved from https://www.scien.cx/2023/05/14/reverse-string-in-java/

MLA
" » reverse string in java." NJ | Sciencx - Sunday May 14, 2023, https://www.scien.cx/2023/05/14/reverse-string-in-java/
HARVARD
NJ | Sciencx Sunday May 14, 2023 » reverse string in java., viewed ,<https://www.scien.cx/2023/05/14/reverse-string-in-java/>
VANCOUVER
NJ | Sciencx - » reverse string in java. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2023/05/14/reverse-string-in-java/
CHICAGO
" » reverse string in java." NJ | Sciencx - Accessed . https://www.scien.cx/2023/05/14/reverse-string-in-java/
IEEE
" » reverse string in java." NJ | Sciencx [Online]. Available: https://www.scien.cx/2023/05/14/reverse-string-in-java/. [Accessed: ]
rf:citation
» reverse string in java | NJ | Sciencx | https://www.scien.cx/2023/05/14/reverse-string-in-java/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.