nerdexam
Oracle

1Z0-809 · Question #7

Given the code fragments: class TechName { String techName; TechName (String techName) { this.techName=techName; } } and List<TechName> tech = Arrays.asList ( new TechName("Java"), new…

The correct answer is B. stre.map(a-> a.techName).forEach(System.out::print). You've hit your session limit · resets 5:20pm (America/New_York)

Question

Given the code fragments: class TechName { String techName; TechName (String techName) { this.techName=techName; } } and List<TechName> tech = Arrays.asList ( new TechName("Java"), new TechName("Oracle DB-"), new TechName("J2EE-") ); Stream<TechName> stre = tech.stream(); //line n1 Which should be inserted at line n1 to print Java-Oracle DB-J2EE-?

Options

  • Astre.forEach(System.out.print);
  • Bstre.map(a-> a.techName).forEach(System.out::print);
  • Cstre.map(a-> a).forEachOrdered(System.out::print);
  • Dstre.forEachOrdered(System.out.print);

How the community answered

(41 responses)
  • A
    5% (2)
  • B
    80% (33)
  • C
    12% (5)
  • D
    2% (1)

Explanation

You've hit your session limit · resets 5:20pm (America/New_York)

Community Discussion

No community discussion yet for this question.

Full 1Z0-809 Practice