I have tried to make it successful but I couldn't deal with it even though I've searched many things which is related to this problem on the internet and Stackoverflow.
So what I would like to do is like this.
BiFunction<Integer, Integer, Integer> mul = (a, b) -> a * b;
Map<Character, IntUnaryOperator> commands = new HashMap<>();
commands.put('*', (a, b) -> mul.apply(a, b) );
? // commands.put('*', (a, b) ->{ return a * b;} ); <- Using lambda was impossible as well.
I would like to put a function, 'mul' into the value of hashmap, including recieveing two parmeters. I've just started using Java and I tried to check and read documents but I couldn't find out the way to do this successfully.
I'd be glad if you could help me. Thank you.