r/java • • Mar 21 '21

Java lambdas can deadlock parallel class initialization

https://www.youtube.com/watch?v=_2hZf1kw4A4
230 Upvotes

46 comments sorted by

View all comments

84

u/fredoverflow Mar 21 '21

TL;DW Lambda bodies are implemented as private static methods, but during class initialization, other threads are blocked from calling static methods.

1

u/Prateeeek Mar 22 '21

Hey but lambdas are functional interfaces right?, isn't their method public?