BlackRock

  www.blackrock.com
  www.blackrock.com

Interview Question

Aladdin & Technology Interview(Student Candidate) New York, NY

reverse a string in Java

Answer

Interview Answer

1 Answer

0

public class Reverse {
    public static void main(String[] args) {

        String str = “Reverse this string, please”;
        StringBuilder sb = new StringBuilder(str);

        sb.reverse();

        System.out.println(sb);
    }
}

Chus on Sep 21, 2014

Add Answers or Comments

To comment on this, Sign In or Sign Up.