Java Lambda - ObjIntConsumer example








ObjIntConsumer represents an operation that accepts an object-valued and a int-valued argument, and returns no result. This is the reference, int specialization of BiConsumer.

Method

  1. ObjIntConsumer accept

Example

The following example shows how to use ObjIntConsumer.

import java.util.function.ObjIntConsumer;
/* w  w  w  .  j a  v  a  2  s.  c  om*/
public class Main {

  public static void main(String[] args) {
    ObjIntConsumer<String> i  = (s,d)->System.out.println(s+d);
    
   
    i.accept("java2s.com ",234);
  }
}

The code above generates the following result.