Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Doesn't java now let you have both private methods in interfaces and default implementations of the interface methods?


    $ cat Foo.java
    interface Foo {
        private String jimbo() {
            return "yup";
        }
    }

    $ javap -c -private Foo
    Compiled from "Foo.java"
    interface Foo {
      private java.lang.String jimbo();
        Code:
           0: ldc           #1                  // String yup
           2: areturn
    }
and

    interface Bar {
      default boolean isAwesome() {
        return true;
      }
    }




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: