public class Base
{
void first()
{
System.out.println("first() from base");
second();
}
void second()
{
System.out.println("second() from base");
}
}
class Derived extends Base
{
void second()
{
System.out.println("second() from derived");
}
public static void main(
String args[])
{
Base b = new Derived();
b.first();
}
}
when I call first() in base second()in derived is call how come when it should call second() base. please explain.