How to code a program to get the reverse of a string?
Anónimo
//Reverse a String public class Reverse { public static void main(String[] args) { String s = "Selenium"; String rev =""; for(int i=s.length();i>0;i--) { rev =rev+s.charAt(i-1); } System.out.println(rev); }