Top 1,000 Features Creators Resources Blog Explorer Download
GitHub icon

Virtual function

< >
Example from 1 languages: undefined
class Animal { public: // Intentionally not virtual: void Move(void) { std::cout << "This animal moves in some way" << std::endl; } virtual void Eat(void) = 0; }; // The class "Animal" may possess a definition for Eat if desired. class Llama : public Animal { public: // The non virtual function Move is inherited but not overridden. void Eat(void) override { std::cout << "Llamas eat grass!" << std::endl; } };
Example from 1 languages: undefined
class abc virtual DoSomething (|string| name) behaviour DoSomething printline "hello: $name"
*

Languages with Virtual function include C++, Speedie

*

View all concepts with or missing a hasVirtualFunctions measurement

*

Read more about Virtual function on the web: 1.

View source

- Build the next great programming language About Acknowledgements Extensions Day 631 Donate feedback@pldb.io