class Parent
{
void m1()
{
System.out.println("Inside m1 Method - Parent");
}
}
class Child extends Parent
{
void m1()
{
System.out.println("Inside m1 Method - Child");
}
void add(int a,float b)
{
System.out.println("Inside add Method");
System.out.println(a+b);
this.m1();
super.m1();
}
}
class Demo
{
public static void main(String[] args)
{
//System.out.println("Hello World!");
Child d = new Child();
d.add(10,20.2f);
}
}
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