Why doesn't Java have method delegates?

后端 未结 9 1652
再見小時候
再見小時候 2021-02-05 17:42

The Java gurunaths (natha नाथ = sanskrit for deity-master-protector) at Sun should condescend to accept the necessity of delegates and draft it into Java spec.

In C#, I

9条回答
  •  半阙折子戏
    2021-02-05 18:13

    Here is Tom Ball's account for Microsoft proposal to add them to Java and why Sun rejected them.

    IMO, Java should have had closures twelve years back. Gilad Bracha argued for closures and no one listened. In his own words:

    I personally argued for adding closures since 1997/98. My blood pressure still rises measurably when I recall the response I got at the time: "Our customers aren't asking for it, so why add it?".

    Sad, but true.

提交回复
热议问题