Question 146

Given the code fragments:
4.void doStuff() throws ArithmeticException, NumberFormatException, Exception {
5.if (Math.random() >-1 throw new Exception ("Try again");
6.} and
24.
try {
25.
doStuff ( ):
26.
} catch (ArithmeticException | NumberFormatException | Exception e) {
27.
System.out.println (e.getMessage()); }
28.
catch (Exception e) {
29.
System.out.println (e.getMessage()); }
30.
}
Which modification enables the code to print Try again?
  • Question 147

    Given the code fragment:
    Stream<List<String>> iStr= Stream.of ( Arrays.asList ("1", "John"),
    Arrays.asList ("2", null)0;
    Stream<<String> nInSt = iStr.flatMapToInt ((x) -> x.stream ());
    nInSt.forEach (System.out :: print);
    What is the result?
  • Question 148

    Given:

    What is the result?
  • Question 149

    Given the code fragment:

    What is the result?
  • Question 150

    Given the code fragment:

    What is the result ?
    [X]