java 8 - Java8: foreach set and calling a method with a parameter -


i'm struggling coming out right syntax this:

i have functionalinterface:

@functionalinterface interface observer {     void notifyme(packet p); }; 

and i'm trying make following call:

packet -> observers.foreach(observer::notifyme); 

it doesn't compile! idea how make work?

thanks!


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -