1704308
Ano: 2011
Disciplina: TI - Desenvolvimento de Sistemas
Banca: CESGRANRIO
Orgão: BR Distribuidora
Disciplina: TI - Desenvolvimento de Sistemas
Banca: CESGRANRIO
Orgão: BR Distribuidora
Considere a classe em Java apresentada a seguir.
public class Questao {
public static void main(String[] args) {
try {
op(0);
} catch (IllegalArgumentException e) {
System.out.print ("X");
} catch (Exception e) {
System.out.print ("Y");
} finally {
System.out.print ("Z");
}
}
private static void op(int v) throws IllegalArgumentException {
if (v == 0)
throw new IllegalArgumentException("U");
}
}
public static void main(String[] args) {
try {
op(0);
} catch (IllegalArgumentException e) {
System.out.print ("X");
} catch (Exception e) {
System.out.print ("Y");
} finally {
System.out.print ("Z");
}
}
private static void op(int v) throws IllegalArgumentException {
if (v == 0)
throw new IllegalArgumentException("U");
}
}
Como resultado da execução desse programa, é impressa a cadeia de caracteres
Provas
Questão presente nas seguintes provas
Analista de TI - Desenvolvimento/Java, CRM e Web
70 Questões