3 ms·
Java has always allowed for class members using the "static" keyword. The GoF book predates the public release of Java. The code samples in GoF are in C++ and
by evanspa 9y ago
Java has always allowed for class members using the "static" keyword.
The GoF book predates the public release of Java. The code samples in GoF are in C++ and Smalltalk.
Correct me if I'm wrong, but Java 8 does allow functions to be passed around. E.g., if a function takes as input a Runnable, I can pass a no arg lambda expression as input.
- gozur88 9y agoThere are actually a bunch of different kinds of functions you can use in lambda expressions in Java 8 (43, to be exact). https://www.tutorialspoint.com/java8/java8_functional_interfaces.htm https://www.tutorialspoint.com/java8/java8_functional_interf... Beyond that, by at least 1.4 you could pass methods using the reflections API, though that was kludgy in a lot of ways.