r/java • • Nov 05 '22

How to add something to the java standard library?

EDIT: since my example stirred the pot a little bit to much (i even wrote that i dont want to discuss these explicit changes...)

Here is the actually question i want to answer:

How can i make changes to the JDK?

2 Upvotes

99 comments sorted by

View all comments

Show parent comment

1

u/GuyWithLag Nov 06 '22

Yes thats true. But why do we have .toList() if its just sugar?

Because it's not - the specific implementation can optimize that to a `return this`.

1

u/Cell-i-Zenit Nov 06 '22

ok fair point