0

How to get the Interface Name of a Class which is implementing that Interface from inside the Constructor of that implementing class in Java implementation?

  • 3
    It's not entirely clear what you mean. Please can you show some example code. – Andy Turner Nov 07 '16 at 23:27
  • 3
    Possibly via `getClass().getInterfaces()` (but you may also need to walk up the tree using `getClass().getSuperclass()` if the interface is specified in a superclass). – Andy Turner Nov 07 '16 at 23:29
  • Are you trying to explicitely call the default methods from the interfaces like [this](http://stackoverflow.com/a/19976615/3196458)? – blackpen Nov 07 '16 at 23:31
  • Per @AndyTurner, here's a tutorial: https://www.tutorialspoint.com/java/lang/class_getinterfaces.htm –  Nov 07 '16 at 23:33

0 Answers0