Drop Down

Wednesday, February 6, 2019

Reverse_String_Without_API

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);
}

}


No comments:

Post a Comment

Java 8 Notes Pics