Hacker News new | ask | show | jobs
by evanspa 3217 days 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.

1 comments

There 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_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.