I have below function written in VB.Net, Is there a way to convert this to Java. I tried Consumer()
but it only accepts one parameter.
Dim setFunc
As Action(Of String, Object) = Sub(name, val)
Console.WriteLine
("Test Function. Name: {0}, Value: {1}", name, val)
Have you tried this
BiConsumer<String, Object> setFunc =
(x, y) -> System.out.println("Test Function. Name : " + x + ", Value " + y);