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
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.