// meetod charAt(i) tagastab (i+1). sümboli stringist class getChar { public static void main(String args[]) { String s = "getChar-meetodi demo."; char ch; for (int i=s.length(); i>0; i--){ //length() annab stringi pikkuse ch = s.charAt(i-1); //indeks on i-1, sest //stringi esimese sümboli indeks //on null! System.out.print(ch); } System.out.println(); } }