Question 116

Given the following code for the classes MyException and Test:

What is the result?
  • Question 117

    Given the content of /resourses/Message.properties:
    welcome1="Good day!"
    and given the code fragment:
    Properties prop = new Properties ();
    FileInputStream fis = new FileInputStream
    ("/resources/Message.properties");
    prop.load(fis);
    System.out.println(prop.getProperty("welcome1"));
    System.out.println(prop.getProperty("welcome2", "Test"));//line n1
    System.out.println(prop.getProperty("welcome3"));
    What is the result?
  • Question 118

    Given:

    Which two interfaces can you use to create lambda expressions? (Choose two.)
  • Question 119

    Given the code fragment:
    List<String> listVal = Arrays.asList("Joe", "Paul", "Alice", "Tom");
    System.out.println (
    // line n1
    );
    Which code fragment, when inserted at line n1, enables the code to print the count of string elements whose length is greater than three?
  • Question 120

    Given the code fragment:
    UnaryOperator<Integer> uo1 = s -> s*2; line n1
    List<Double> loanValues = Arrays.asList(1000.0, 2000.0);
    loanValues.stream()
    .filter(lv -> lv >= 1500)
    .map(lv -> uo1.apply(lv))
    .forEach(s -> System.out.print(s + " "));
    What is the result?