I got a problem to figure out the following code the compiler output is MarkHenry55555555, but I thought the actual reference type would be called in the runtime which is a reference of type publication class to give this output "HenryHenry11111111". What I missing here, thanks in advance.
If a method is static then the type of the reference variable will decide what method is called.
If a method is not static then the type of the object the reference is referring to will decide which method is called.
I am still not understanding it, besides I ran the code several times
Isn't supposed when comes to static methods , polymorphism doesn't apply? Isn't exactly the first line Joanne Neal says ? => a method is static then the type of the reference variable will decide what method is called.
Then why the output looks like if polymorphism is applied :S