Which method actually runsintermediate
A virtual method is chosen by the object at run time through a table each object points to; a non-virtual one — including one declared new — is fixed by the variable’s type when the code compiles.
A notification service sends member alerts over SMS, WhatsApp and USSD, using virtual, override and new all at once. Predict the eight lines it prints without running it.
All eight predicted lines match the program’s output exactly.
Published in full, before you start — every point is one of these and there is nothing else.
A virtual method is chosen by the object at run time through a table each object points to; a non-virtual one — including one declared new — is fixed by the variable’s type when the code compiles.