You are on page 1of 1

class One

{
void calculate(int x)
{
System.out.println("Square of x = "+(x*x));
}
}
class Two extends One
{
void calculate(int x)
{
System.out.println("Square root of x = "+Math.sqrt(x));
}
}
class Dpoly
{
public static void main(String args[])
{
Two t = new Two();
t.calculate(25);
}
}

You might also like