top of page
  • 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

}

}





12 views0 comments

Recent Posts

See All

Image Alt Text: What Is It ?

What Is Image Alt Text? Image alt text is a brief, descriptive sentence or phrase that is associated with an image. It is used to help visually impaired people understand what the image is about, and

bottom of page