public class ForDemo {
  
  /**
   * initialization;
   * while(condition) {
   *   body
   *   updatestatement
   * }
   * 
   * for(initialization; condition; updatestatement) {
   *   body
   * }
   * 
   * For loops are good to use when you know the range
   * and bad otherwise.
   */ 
  
  /** 
   * Return the string s with the characters reversed.
   */ 
  public static String reverse(String s) { 
    String rev = "";
    
    for (int i = 0; i < s.length(); i++) {
      rev = s.charAt(i) + rev;
    }
    
    return rev;
  }
}