ANother one of the mock up exam question has this code:
Now, this apparently prints
Beta 44
4 44
Beta 44
44 44
I couldn't figure out how it printed that, so I run the class here in the console, and I do get indeed that output (I thought it might have been a mistake or something). Problem is, still I don't understand how it gets that output. I'm not talking about the concept of
polymorphism as such, I'm just referrring to the actual output. The first print statement executed is
which prints an integer and not a
string so how come the output starts with Beta and not with an integer?!