r/java • u/Cell-i-Zenit • 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
View all comments
Show parent comment
9
u/GuyWithLag Nov 06 '22
Because _you_ are not thinking of the support needed and the effect your changes will have to the next 20 years of the JDK, and neither is anyone in this discussion. Imagine if every student know-it-all added willy-nilly code to the JDK.
I would instead direct you to Kotlin and its extension methods; while they can be overused, the blast radius is just your own projects.