1z0-809 Exam Question 56

Given the code fragment:
ZonedDateTime depart = ZonedDateTime.of(2015, 1, 15, 3, 0, 0, 0, ZoneID.of("UTC-7")); ZonedDateTime arrive = ZonedDateTime.of(2015, 1, 15, 9, 0, 0, 0, ZoneID.of("UTC-5")); long hrs = ChronoUnit.HOURS.between(depart, arrive); //line n1 System.out.println("Travel time is" + hrs + "hours"); What is the result?
  • 1z0-809 Exam Question 57

    Given:
    class Student {
    String course, name, city;
    public Student (String name, String course, String city) {
    this.course = course; this.name = name; this.city = city;
    }
    public String toString() {
    return course + ":" + name + ":" + city;
    }
    public String getCourse() {return course;}
    public String getName() {return name;}
    public String getCity() {return city;}
    and the code fragment:
    List<Student> stds = Arrays.asList(
    new Student ("Jessy", "Java ME", "Chicago"),
    new Student ("Helen", "Java EE", "Houston"),
    new Student ("Mark", "Java ME", "Chicago"));
    stds.stream()
    .collect(Collectors.groupingBy(Student::getCourse))
    .forEach(src, res) -> System.out.println(scr));
    What is the result?
  • 1z0-809 Exam Question 58

    Given the code fragment:
    List<String> colors = Arrays.asList("red", "green", "yellow");
    Predicate<String> test = n - > {
    System.out.println("Searching...");
    return n.contains("red");
    };
    colors.stream()
    . filter(c -> c.length() > 3)
    . allMatch(test);
    What is the result?
  • 1z0-809 Exam Question 59

    Given the code fragment

    Which code fragments, inserted independently, enable the code compile?
  • 1z0-809 Exam Question 60

    Given the code fragment:
    public static void main (String [ ] args) throws IOException {
    BufferedReader br = new BufferedReader (new InputStremReader (System.in));
    System.out.print ("Enter GDP: ");
    / /line 1
    }
    Which code fragment, when inserted at line 1, enables the code to read the GDP from the user?