Hi,
What is the difference between Fridge function and Virtual function?
Thank you.
Difference between Fridge function and Virtual function
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Jun 3, 2012, 1:18 AM EDT
Googling it has also yielded a blank.
However, a virtual function (or method as they usually called in C#) is a function which can be overridden in sub-classes which want to provide their own implementation of it.
At runtime, the actual type of the object (not necessarily its compile-time type) determines which version of the virtual method to call. For example, if SomeMethod is a virtual function of the Parent class which is over-ridden in the Child sub-class:
Parent p = new Parent();
p.SomeMethod(); // calls Parent's version
p = new Child();
p.SomeMethod(); // calls Child's version because 'p' refers to a Child object, not a Parent object
FroglegRank #1,020 · 1.9K reputationPosted Jun 3, 2012, 1:26 AM EDT
A virtual function is where you sit thinking of drinking a beer
VulpesRank #55 · 29.2K reputationPosted Jun 3, 2012, 4:01 AM EDT
But, joking apart, can you think what Ankur might be referring to here? May be there's some word that sounds a bit like fridge which can be applied to functions.