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

sql - Time in datatime field -

javascript - How to split the success output from an Ajax post? -

java - sharing object across different classes -