

Seu próximo nível começa aqui
Seu desenvolvimento não pode ter limites. Garanta sua Assinatura Ilimitada e libere uma preparação completa com os melhores professores do Brasil.
Analisando o código java a seguir, assinale a alternativa que apresenta a saída caso a terceira linha do programa fosse alterada para String test = “no”;. Considere UFRJException como uma classe que estende Exception.
1.__ public class UFRJ {
2.____ public static void main(String [] args) {
3.______ String test = "yes";
4.______ try {
5.________ System .out.printIn("start try");
6.________ ufrjTeste(test);
7.________ System.out.printIn("end try");
8.______ } catch(UFRJException se) {
9.________ System.out.printIn("ufrj exception");
10._____ } finally {
11._______ System.out.printIn("finally");
12._____ }
13._____ System.out.printIn ("end of main");
14.____ }
15.____ static void ufrjTeste(String test) throws UFRJException {
16._______ System.out.printIn("start teste");
17._______ if ("yes".equals(test))
18._________ trow new UFRJException();
19._______ System.out.printIn("end teste");
20.____ }
21._}
start try – start teste – ufrj exception – finally – end of main
start try – start teste – ufrj exception – end of main – finally
start try – end teste – start teste – end try – end of main – finally
start try – start teste – end teste – end try – finally – end of main
start try – end teste – start teste – end try – finally – end of main