Overload Default Interface Method in Java 8 -


why not possible overload default methods in interface in java 8.

the assumption in question ("why not possible overload default methods in interface in java 8") not true. possible overload interface's default method. e.g., consider following code compiles fine:

public interface someinterface {     default void print(string s) {         system.out.println(s);     } }  public class someclass implements someinterface {     /**      * note overloads {@link someinterface#print(string)},       * not overrides it!      */     public void print(int i) {         system.out.println(i);     } } 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -