I'm very new to Lambda, and I would like to have a Generic class done so like a non-generic class. Take for example the Runnable, it isn't generic:
Runnable runnable = () -> {
// code here
}
And I had a Generic class, how would I do it in Lambda just like I can with a non-generic class?
MyGenericClass<T> generic = ...
Runnableis not genericFunctionalInterface(though the annotation itself is not mandatory). See Function<> or Predicate<> for examples of easy-to-understand generic functional interfaces.Runnabledoesn't have any type parameters. What are you trying to achieve? You may need to useCallable.