Credit Suisse Interview Question: Calling virtual function in t... | Glassdoor

Interview Question

Software Developer Interview London, England (UK)

Calling virtual function in the constructor of child class?


Interview Answer

2 Answers


it won't work.

Anonymous on Feb 11, 2016

If the child class implements the virtual function as well, that function will be called.
If the child class doesn't implement the virtual function, it will try to call its parent's virtual function if implemented, otherwise, compile error.

Anonymous on Feb 11, 2016

Add Answers or Comments

To comment on this, Sign In or Sign Up.