Skip to content

Instantly share code, notes, and snippets.

@iyengarajay
Created June 1, 2016 13:02
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save iyengarajay/d39ebf695958084baa3db92cf8c1a1f7 to your computer and use it in GitHub Desktop.
interface Parent
{
default public void methodOne() {
System.out.println("Parent : Method one...");
}
default public void methodTwo() {
System.out.println("Parent : Method two...");
}
}
interface Child extends Parent
{
//overrides methodTwo
default public void methodTwo(){
System.out.println("Child : Method two...");
}
}
public class ConcreteClass implements Child
{
public static void main(String[] args)
{
ConcreteClass concreteClass = new ConcreteClass ();
concreteClass.methodOne();
concreteClass.methodTwo();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment