What's the nearest substitute for a function pointer in Java?

前端 未结 22 1780
太阳男子
太阳男子 2020-11-22 15:32

I have a method that\'s about ten lines of code. I want to create more methods that do exactly the same thing, except for a small calculation that\'s going to change one li

22条回答
  •  深忆病人
    2020-11-22 16:31

    You may also be interested to hear about work going on for Java 7 involving closures:

    What’s the current state of closures in Java?

    http://gafter.blogspot.com/2006/08/closures-for-java.html
    http://tech.puredanger.com/java7/#closures

提交回复
热议问题