java - Can we use the Lambda Expression for WindowListener? if yes how? if no why? Can i set the Lambda Expression for the below code snippet? -


this question has answer here:

this.addwindowlistener(new windowadaptor(){ public void windowclosing(windowevent we) {     system.exit(0);//to close window } }); 

this request, please make code using lambda expression.

a lambda expression can substitute functional interface (i.e. interface single non default method). therefore windowadapter, has multiple methods (windowactivated(windowevent e), windowclosed(windowevent e), windowclosing(windowevent e), ...), can't substituted lambda expression.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -