0

Where there is already a java substitute for this functional interface:

public interface FunctionA {
       public void run(Person person, Object target);
}

in the form of

BiConsumer<Person, Object>

is there one for this abstract class:

public abstract class ApplicationPlugin {

public abstract void init();

}

where usage is:

public class X extends ApplicationPlugin {
@Override public void init(){
    //stuff
}
}
Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
kay
  • 451
  • 1
  • 3
  • 13
  • Yes, `Runnable`. – daniu Jun 14 '18 at 10:27
  • No idea why this was tagged `assembly`, because I don't see any CPU instructions or Java bytecode-asm (which has its own tag: [tag:java-bytecode-asm]). Was this supposed to be tagged [tag:.net-assembly]? – Peter Cordes Jun 14 '18 at 10:46

1 Answers1

0

Yes, you're looking for the Runnable interface which has a single method taking no parameters and has a void return type.

e.g.

Runnable runnable = () -> doSomething();
Ousmane D.
  • 54,915
  • 8
  • 91
  • 126