Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lecture 11 P7 #385

Open
Guo-Yujia opened this issue Apr 27, 2021 · 3 comments
Open

Lecture 11 P7 #385

Guo-Yujia opened this issue Apr 27, 2021 · 3 comments
Labels
🧠 Finals Q&A Questions related to Finals

Comments

@Guo-Yujia
Copy link

Summary

For page 7 in lecture 11, some alternative ways are provided to replace forEach(), can someone give some example on how we should use forEachOrdered and CopyOnWriteArrayList. By the way, may I clarify that does the encountered order mean the order of elements being passed into the function?

Screenshots (if any):

image

@Guo-Yujia Guo-Yujia added the 🧠 Finals Q&A Questions related to Finals label Apr 27, 2021
@Guo-Yujia
Copy link
Author

To add on to the question, what is the difference between collect, collector and collectors?

@brendancjz
Copy link

Encounter order is the order in which the Stream encounters data. So, it is wrong to say it is the order in which the elements are added into the function.

@poryduckZ
Copy link

To add on to the question, what is the difference between collect, collector and collectors?

Collect is a method. Collector is an interface and Collectors is the class that implements the Collector interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧠 Finals Q&A Questions related to Finals
Projects
None yet
Development

No branches or pull requests

3 participants