fork download
  1. class Ideone {
  2. public static void main (String[] args) {
  3. Foo foo = new Bar();
  4. System.out.println(foo.fooName());
  5. }
  6. }
  7.  
  8. interface Foo {
  9. public default String fooName() {
  10. return this.getClass().getName();
  11. }
  12. }
  13.  
  14. class Bar implements Foo {}
Success #stdin #stdout 0.07s 32464KB
stdin
Standard input is empty
stdout
Bar