class Base
{
void display( )
{
System.out.println("Base Class Method");
}
}
class Derived extends Base
{
void display( )
{
System.out.println("Derived Class Method");
}
void show( )
{
display( );
super.display( );
}
}
class TestSuper2
{
public static void main(String args[ ])
{
Derived d=new Derived( );
d.show( );
}
}
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