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)- A5% (2)
- B80% (33)
- C12% (5)
- D2% (1)
Explanation
You've hit your session limit · resets 5:20pm (America/New_York)
Community Discussion
No community discussion yet for this question.