What is the difference between an abstract function and a virtual function

0 votes
What is the difference between an abstract function and a virtual function? In which cases is it recommended to use virtual or abstract? Which one is the best approach?
Nov 30, 2020 in Python by anonymous
• 10,520 points
725 views

1 answer to this question.

0 votes

An abstract function cannot have functionality. You're basically saying, any child class MUST give their own version of this method, however it's too general to even try to implement in the parent class.

A virtual function, is basically saying look, here's the functionality that may or may not be good enough for the child class. So if it is good enough, use this method, if not, then override me, and provide your own functionality.

answered Nov 30, 2020 by Gitika
• 65,910 points

Related Questions In Python

0 votes
1 answer

What is the difference between map() and filter() function in python?

The map() function is a type of ...READ MORE

answered Jun 25, 2020 in Python by Sirajul
• 59,230 points
2,299 views
0 votes
1 answer

What is the difference between list and tuple?

Lists are mutable(values can be changed) whereas ...READ MORE

answered May 5, 2018 in Python by aayushi
• 750 points
6,520 views
+1 vote
2 answers

What is the difference between classes and labels in machine learning?

Classes and Labels both are almost same things ...READ MORE

answered Apr 3, 2019 in Python by SA
• 1,090 points
7,020 views
0 votes
1 answer

What is the difference between Python and IPython?

There are few differences between Python and ...READ MORE

answered Jul 26, 2018 in Python by Priyaj
• 58,090 points
3,725 views
+1 vote
2 answers

Difference: abstract class and interface in Python

If abstract class contains only abstract methods ...READ MORE

answered Jun 21, 2019 in Python by anonymous
7,286 views
0 votes
0 answers

When to use an interface instead of an abstract class and vice versa

This could be an OOP question in ...READ MORE

Jun 11, 2022 in C# by pranav
• 2,590 points
206 views
0 votes
0 answers

Interface or an Abstract Class: which one to use?

Could you please explain when I should ...READ MORE

Aug 8, 2022 in PHP by Kithuzzz
• 38,010 points
568 views
0 votes
1 answer

Can Abstract Class have a Constructor?

Yes, an abstract class can have a ...READ MORE

answered May 11, 2018 in Java by sharth
• 3,370 points
906 views
0 votes
1 answer

What is the difference between an interface and abstract class?

Interfaces An interface is a contract: The person writing ...READ MORE

answered Nov 30, 2020 in Python by Gitika
• 65,910 points
606 views
0 votes
5 answers
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP