package interview;
public class Reverse_String_Without_API {
public static void main(String[] args)
{
String str = "Gopalpur";
String reverse = "";
char[] ch = str.toCharArray();
for(int i = ch.length-1; i>=0;i--)
{
reverse = reverse +ch[i];
}
System.out.println(reverse);
}
}
public class Reverse_String_Without_API {
public static void main(String[] args)
{
String str = "Gopalpur";
String reverse = "";
char[] ch = str.toCharArray();
for(int i = ch.length-1; i>=0;i--)
{
reverse = reverse +ch[i];
}
System.out.println(reverse);
}
}
No comments:
Post a Comment