Does Java have native support for events, similar to that of C#?

前端 未结 9 2002
眼角桃花
眼角桃花 2020-12-19 03:19

I\'m a bit confused from what I\'ve heard Java doesn\'t do events.

But I know that it does GUI events.

Am I missing something? Does java have an event handli

9条回答
  •  Happy的楠姐
    2020-12-19 03:50

    As you already stated, you can do the exact same thing with the publisher-subscriber/Observer pattern. It just requires a bit more legwork.

    And no, Java does not have native support for events, like C# does with delegates.

提交回复
热议问题