All Virtual Methods Are Abstract in CPP

Virtual is a keyword to declare that the method must be override

If all method is virtual and equals 0, the class runs as an interface.

Override keywords shows that the virtual method has been overridden.

The shared pointer is the smart pointer way to declare a variable as a pointer. You also use a unique pointer too.

The base classes deconstruction method should be virtual every time. Otherwise, its deconstruction doesn’t work in polimofic cases.

You can not override the inherited method if it is not mentioned by virtual keyword. If a class not suitable for inheriting we should mark it with final keyword.

Leave a Reply

Your email address will not be published. Required fields are marked *