Josh Software Interview Question

Reverse a string in Java without using . reverse()

Interview Answer

Anonymous

Sep 28, 2025

Public static ReverseString{ public static void main(String[]args){ String str="Hello"; String reversed=""; for(int i=str.length()-1;i>=0;i--){ reversed+=str.charAt(i); } System.out.println("The reversed string is "+reversed); } }