0
I’m doing a college project where I have to develop a calculator with Java. I am trying to find a way to pass lambda functions as a parameter so that it is possible to put these functions inside a list, so the calculator would have several options of operations to be performed.
I know there are other ways to execute the same idea using different methods, but I would like to do so. The problem is that I don’t know which object to use to receive lambda as a function parameter. I chose lambda instead of lambda Runnable
and Callable
because lambda can return values, it is easier for a new developer to implement a new operation in the calculator, as it just needs to add lambda equivalent operation and some more information.
The ideal would be to show how it has at this time to be easier to understand its difficulties
– Isac