- pairinterview
Java Coding question Reverse String
Write a Java program to reverse a string without using any in-built functions.
Example 1:
Sample Input: "hello world"
Sample Output: "dlrow olleh"
Example 2:
Sample Input: "world"
Sample Output: "dlrow"
public class ReverseString {
public static void main(String[] args)
{
String str = "hello world";
// Write your code here to reverse the string
}
}