What are virtual functions in C++ and what do they look like to a java developer

In Java, there is dynamic binding.

 

In C++, you can specifically do that with some functions by writing that they need to be used with virtual keyword. Then they will be called dynamically. This gives more liberty and puts more onus on the developer.

 

12.2 — Virtual functions and polymorphism

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: