I'm doing a college job where I have to develop a calculator with Java. I'm trying to figure out how to pass lambda functions as a parameter so that it's possible to put these functions into a list, so the calculator would have several options to perform operations.
I know there are other ways of running the same idea using different methods, but I'd like to do so. The problem is that I do not know which object to use to receive lambda as a parameter by function. I chose lambda instead of Runnable
and Callable
since in addition lambda can return values, it is easier for a new developer to implement a new operation on the calculator, since it only needs to add the lambda equivalent to the operation and some more information.