我有在C#中,看起来像代码:
Action<Guid, QueryResult> onData = (guid, data) =>
{
total += data.NumberOfRows;
Console.WriteLine("Guid: {0} Number of rows: {1}", guid, data.NumberOfRows);
};
我想在Java中复制这一点,但是我不能确定相应的Java的,以取代操作码
谁能指教?
这里是:
BiConsumer<String, Integer> resultBiConsumer = new BiConsumer<Guid, QueryResult>() {
@Override
public void accept(Guid s, QueryResult data) {
total += data.numberOfRows;
System.out.printf("Guid: %s Number of rows: %d%n", s, data.numberOfRows);
}
};