小编vil*_*.ch的帖子

什么是Java 8 java.util.function.Consumer <>的c#等价物?

在C#中是否有相当于这个接口?

例:

Consumer<Byte> consumer = new Consumer<>();
consumer.accept(data[11]);
Run Code Online (Sandbox Code Playgroud)

我四处搜寻Func<>,Action<>但我不知道.

Consumer.accept()接口的原始Java代码非常简单.但不适合我:

void accept(T t);

/**
* Returns a composed {@code Consumer} that performs, in sequence, this
* operation followed by the {@code after} operation. If performing either
* operation throws an exception, it is relayed to the caller of the
* composed operation.  If performing this operation throws an exception,
* the {@code after} operation will not be performed.
*
* @param after the operation to …
Run Code Online (Sandbox Code Playgroud)

c# java consumer

7
推荐指数
1
解决办法
3174
查看次数

标签 统计

c# ×1

consumer ×1

java ×1