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
  • 27,789
  • 26
  • 218
  • 353
user1555190
  • 2,803
  • 8
  • 47
  • 80

1 Answers1

-1

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

user1555190
  • 2,803
  • 8
  • 47
  • 80