java - Invoking a default method inside a static method of interface -


i need call default method inside interface's static method (two methods in same interface- 1 default , other 1 static). possible? if so, how can achieve this?

look @ code portion better understand question:

interface a{ default void callee(){         //do here     }      static void caller(){         //call callee() method anyhow     } } 

you need instance call non-static method.

static void caller() {     new a(){}.callee(); } 

it better avoid static non-static calls. suppose can extract part of callee static method.


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -