Are classes nestled in Java like closures?

Asked

Viewed 63 times

2

I have heard that nested classes have closurelike behavior. This is correct?

  • 2

    One might say yes in some situations, but not exactly, they are used to replace closures. It is a more exposed mechanism and a little more flexible. It can be used for other things. As now Java has closure it will tend to be less used in new Apis (at least for that). But it’s still useful. If so, I’ll try a response later.

  • @Bigown Would be very nice, thank you!

  • Have an example?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.