0

I came across the following code:

List<Fields> invFieldsLst = new ArrayList<>();
InvListener listener = invFieldsLst::add;

The following interface:

public interface InvListener {

  void test(Fields fields);

}

How does the double :: even work? I just dont understand how thats working..

Naman
  • 21,685
  • 24
  • 196
  • 332
user1555190
  • 2,325
  • 7
  • 39
  • 67

1 Answers1

-1

got it.. basically its eqv too (i) -> { invFieldsLst.add(i); }; its an impl for that method

user1555190
  • 2,325
  • 7
  • 39
  • 67