When methods are overloaded reference type matters. So call to obj.meth(y); will call the super class because the reference type is of the superclass. y is a integer variable so widening occurs to long and you get the output "parent".
Now in this call to new B().meth(b); the variable you pass to the meth() is long and since subclass B has both the versions of meth it will call the class A meth() that takes long as an argument.
Hope this helps you
Srividhya
It runs on an internal combustion engine. This ad does not:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth