public class StringReverse {
public static void main(String[] args) {
String str="selenium",reverse="";
for(int i=str.length()-1;i>=0;i--) {
reverse=reverse+str.charAt(i);
}
System.out.println(reverse);
}
}
Output: muineles
public static void main(String[] args) {
String str="selenium",reverse="";
for(int i=str.length()-1;i>=0;i--) {
reverse=reverse+str.charAt(i);
}
System.out.println(reverse);
}
}
Output: muineles
0 comments:
Post a Comment