I have a method that's about 10 lines of code. I want to create more methods that do the exact same thing except for a calculation that's going to change one line of code. This is a perfect application for passing in a function pointer to replace that one line, but Java doesn't have function pointers. What's my best alternative?
Ccna final exam - java, php, javascript, ios, cshap all in one. This is a collaboratively edited question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
Showing posts with label function-pointers. Show all posts
Showing posts with label function-pointers. Show all posts
Wednesday, May 30, 2012
What"s the nearest substitute for a function pointer in Java?
Subscribe to:
Posts (Atom)