April 05
Prof. Ismael H. F. Santos -  ismael@tecgraf.puc-rio.br                                                          2
Fundamentos da Linguagem
nExemplo
n public class StringsDemo {
n   public static void main(String[] args) {
n     String palindrome = “Niagara. O roar again";
n       int len = palindrome.length();
n       StringBuffer dest = new StringBuffer(len);
n       for (int i=len-1; i >= 0; i--)                 dest.append(palindrome.charAt(i));
n     System.out.println(dest.toString());
n   }
n }
n