• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Java SE 8 Prog II - Online Test- Exam-2

 
Greenhorn
Posts: 13
1
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no terminal operation  in this example, which makes the answers for this question to be invalid.

List<Integer> l1 = Arrays.asList();
List<Integer> l2 = Arrays.asList(1, 2, 3);
List<Integer> l3 = Arrays.asList(4, 5, 6);

Stream.of(l1, l2, l3)
   .limit(2)
   .peek(System.out::println) // peek 1
   .flatMap(x -> x.stream())
   .peek(System.out::println) // peek 2
   .map(x -> x + 1);
===================

Please Ignore:
the answers do consider that there is no terminal operation. There is no issues.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!