Forum Stats

  • 3,722,787 Users
  • 2,244,413 Discussions
  • 7,850,088 Comments

Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Quiz 3

Dmytro Mitin
Dmytro Mitin Member Posts: 3
edited December 2016 in Java Lambda MOOC
The groupingBy() method of the Collectors class returns an object of what type? Set / Collection / List / Map

Actually the static method Collectors.groupingBy() returns a Collector rather than a Set, Collection, List or Map. [Link]
It's Stream#collect(..) method (applied to the collector) that returns a Map.

Dmytro Mitin

Answers

  • NickR2600-Oracle
    NickR2600-Oracle Member Posts: 530 Employee
    edited December 2016

    Hi Dmytro,

    I was wondering about this too.  I've pinged some of the Java Engineers to see if they could offer any clarification.  In the meantime, how would you recommend the quiz question be re-worded?

    Nick

    Dmytro Mitin
  • Dmytro Mitin
    Dmytro Mitin Member Posts: 3
    edited December 2016

    Dear Nick,

    Thank you for your response.

    Well, possible rewording of the question depends on what knowledge learners should demonstrate according to quiz composers' pedagogical goals. Should learners demonstrate deep understanding of collector framework (including that the method returns a collector rather than a collection) or how to apply collectors in order to obtain particular collection.

    For example one more option "Collector" can be added to Set / Collection / List / Map.

Sign In or Register to comment.