interface D
{
default void call()
{
plus(10,20);
}
private void plus(int x,int y)
{
System.out.println("plus answer will be "+(x+y));
}
}
class X implements D
{
public void subtract(int x, int y)
{
System.out.println("subtract answer will be "+(x-y));
}
}
class C
{
public static void main(String[] args)
{
X r= new X();
r.call();
r.subtract(20,10);
}
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter