Question 16

Which of the following isn't a valid option of the jdeps command?
  • Question 17

    What is the output of the following snippet? (Assume the file exists)
    java
    Path path = Paths.get("C:\\home\\joe\\foo");
    System.out.println(path.getName(0));
  • Question 18

    Given:
    var cabarets = new TreeMap<>();
    cabarets.put(1, "Moulin Rouge");
    cabarets.put(2, "Crazy Horse");
    cabarets.put(3, "Paradis Latin");
    cabarets.put(4, "Le Lido");
    cabarets.put(5, "Folies Bergere");
    System.out.println(cabarets.subMap(2, true, 5, false));
    What is printed?
  • Question 19

    Given:
    java
    String s = " ";
    System.out.print("[" + s.strip());
    s = " hello ";
    System.out.print("," + s.strip());
    s = "h i ";
    System.out.print("," + s.strip() + "]");
    What is printed?
  • Question 20

    Given:
    java
    var array1 = new String[]{ "foo", "bar", "buz" };
    var array2[] = { "foo", "bar", "buz" };
    var array3 = new String[3] { "foo", "bar", "buz" };
    var array4 = { "foo", "bar", "buz" };
    String array5[] = new String[]{ "foo", "bar", "buz" };
    Which arrays compile? (Select 2)