• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 14
1
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic