Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

# BiConsumer


`
public


interface
BiConsumer
`


`


`

|---|
| java.util.function.BiConsumer\<T, U\> |

<br />

*** ** * ** ***

Represents an operation that accepts two input arguments and returns no
result. This is the two-arity specialization of `https://developer.android.com/reference/java/util/function/Consumer`.
Unlike most other functional interfaces, `BiConsumer` is expected
to operate via side-effects.

This is a [functional interface](https://developer.android.com/reference/java/util/function/package-summary)
whose functional method is `https://developer.android.com/reference/java/util/function/BiConsumer#accept(T,%20U)`.
**See also:**

- `https://developer.android.com/reference/java/util/function/Consumer`

## Summary

| ### Public methods ||
|---|---|
| ` abstract void` | ` https://developer.android.com/reference/java/util/function/BiConsumer#accept(T,%20U)(T t, U u) ` Performs this operation on the given arguments. |
| ` default https://developer.android.com/reference/java/util/function/BiConsumer<T, U>` | ` https://developer.android.com/reference/java/util/function/BiConsumer#andThen(java.util.function.BiConsumer<?%20super%20T,?%20super%20U>)(https://developer.android.com/reference/java/util/function/BiConsumer<? super T, ? super U> after) ` Returns a composed `BiConsumer` that performs, in sequence, this operation followed by the `after` operation. |

## Public methods

### accept

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract void accept (T t, 
                U u)
```

Performs this operation on the given arguments.

<br />

| Parameters ||
|---|---|
| `t` | `T`: the first input argument <br /> |
| `u` | `U`: the second input argument <br /> |

### andThen

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public BiConsumer<T, U> andThen (BiConsumer<? super T, ? super U> after)
```

Returns a composed `BiConsumer` that performs, in sequence, this
operation followed by the `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 `after` operation will not be performed.

<br />

| Parameters ||
|---|---|
| `after` | `BiConsumer`: the operation to perform after this operation <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/function/BiConsumer<T, U>` | a composed `BiConsumer` that performs in sequence this operation followed by the `after` operation <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if `after` is null |