• 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
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

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

 
Radha Sahoo
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!