demonstrate concept of Polymorphism (Overriden).
Sourse Code:
class Funcover
{
public void calc(int x,int y)
{
int z;
z=x*y;
System.out.println("multiplication="+z);
}
}
class Override extends Funcover
{
public void calc(int x,int y)
{
int z;
z=x/y;
System.out.print("division="+z);
}
}
class Overrideex
{
public static void main(String arg[])
{
Funcover f1=new Funcover();
f1.calc(7,6);
Override f2=new Override();
f2.calc(14,2);
}
}