class Cubic
{
double getCubic(int n)
{
return 0;
}
}
abstract class Sqrt
{
public abstract double getSqrt(int x);
}
class A
{
void f(Cubic cubic)
{
double result = cubic.getCubic(3);
System.out.println(result);
}
}
public class ExamNonclass
{
public static void main(String args[])
{
A a = new A();
a.f(new Cubic()
{
double getCubic(int n)
{
return n*n*n;
}
}
);
Sqrt ss = new Sqrt()
{
public double getSqrt(int x)
{
return Math.sqrt(x);
}
};
double m = ss.getSqrt(5);
System.out.println(m);
}
}