import java.util.*;
class Estudos {
public static void main
(String[] args
) { Scanner in
= new Scanner
(System.
in); System.
out.
print("Informe um inteiro: "); int indice = in.nextInt();
try {
System.
out.
println("O caractere no índice informado é " + palavra.
charAt(indice
)); }
System.
out.
println("Erro:" + e.
getMessage()); }
}
}
//http://pt.stackoverflow.com/q/17025/101
aW1wb3J0IGphdmEudXRpbC4qOwogICAgCmNsYXNzIEVzdHVkb3MgewogICAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgewogICAgICAgIFN0cmluZyBwYWxhdnJhID0gIkphdmEiOyAgICAKICAgICAgICBTY2FubmVyIGluID0gbmV3IFNjYW5uZXIoU3lzdGVtLmluKTsKICAgICAgICBTeXN0ZW0ub3V0LnByaW50KCJJbmZvcm1lIHVtIGludGVpcm86ICIpOwogICAgICAgIGludCBpbmRpY2UgPSBpbi5uZXh0SW50KCk7CiAgICAgICAgdHJ5IHsKICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJPIGNhcmFjdGVyZSBubyDDrW5kaWNlIGluZm9ybWFkbyDDqSAiICsgcGFsYXZyYS5jaGFyQXQoaW5kaWNlKSk7CiAgICAgICAgfQogICAgICAgIGNhdGNoKFN0cmluZ0luZGV4T3V0T2ZCb3VuZHNFeGNlcHRpb24gZSkgewogICAgICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oIkVycm86IiArIGUuZ2V0TWVzc2FnZSgpKTsKICAgICAgICB9CiAgICB9Cn0KCi8vaHR0cDovL3B0LnN0YWNrb3ZlcmZsb3cuY29tL3EvMTcwMjUvMTAx