public class Test extends Test2
{
Test() { }
public void testMethod(){
System.out.println("method in Test----son");
}
public static void main(String[] args)
{
Test t=new Test();
t.f();
}
}
class Test2
{
Test2() { }
public void testMethod(){
System.out.println("method in Test2----dad");
}
public void f(){
testMethod();
this.testMethod();
}
}
**********************************************************************************************************
What is the output? This is tricky if you do not know the exact meaning of "this".
*********************************************************************************************************
OUTPUT:
E:/MyDoc/Exercises>java Test
method in Test----son
method in Test----son
.