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

21/22 Q4b generate vs new MyStream<T> #337

Open
cyiting opened this issue Nov 29, 2022 · 3 comments
Open

21/22 Q4b generate vs new MyStream<T> #337

cyiting opened this issue Nov 29, 2022 · 3 comments

Comments

@cyiting
Copy link

cyiting commented Nov 29, 2022

For those that have attempted this question, can I check if there is any difference between returning a new MyStream<T> vs just calling the static generate method for the map method? Prof's walkthrough returns a new MyStream<T> but is it considered less preferable to call the generate method since both return the same outcome?

@ziyi105
Copy link

ziyi105 commented Nov 29, 2022

I used generate as well, but I am also not very sure if that is acceptable

@siqirua
Copy link

siqirua commented Nov 29, 2022

from my opinion, I think it also works well and it also helps avoid the overflow when using this.get() instead of MyStream.this.get()

@FredericChow00
Copy link

I think using generate would be fine too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants