Hi All,
I have started
java recently. Got a snippet of a code. can anybody please explain this inheritance?
I have got 2 classes Test1 and Test2. Test1 inherits Test2.
The output is :
20
Executing method of Test1
but when I am replacing
Test1 with
Test2 The output is :
40
Executing method of Test1
It is showing accessing the instance variable of Test2 class but method of Test1 class why?
Please help. Thank you.
Regards,
Bhaskar