What is the difference between polymorphism and abstract class ?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

What is the difference between polymorphism and abstract class ??

If we pick up the class "shape" program in which three classes are used that is Rectangle, Circle and square ,,,,, and use one method "void area" to find area. Now with the use of this program can anyone tell me what's the exact difference between polymorphism and abstraction ,,,,,, I'm a little bit confuse in these two topics because both can do "one action performed by different ways". Can anyone help me this out ??

26th Mar 2018, 2:34 PM
Rajan Singla
Rajan Singla - avatar
6 Answers
+ 4
An abstract class and polymorphism are not interchangeable concepts. An abstract class is one of the polymorphism tools. Overriding abstract methods of an abstract class, this refers to polymorphism. Also, polymorphism involves overloading functions.
26th Mar 2018, 3:08 PM
Aidos Zhakupov
Aidos Zhakupov - avatar
+ 3
An abstract class is polymorphism. Abstract classes implement in practice one of the principles of OOP - polymorphism.
26th Mar 2018, 2:49 PM
Aidos Zhakupov
Aidos Zhakupov - avatar
+ 2
Yes
26th Mar 2018, 3:02 PM
Aidos Zhakupov
Aidos Zhakupov - avatar
+ 1
your mean Abstraction = polymorphism ??
26th Mar 2018, 2:52 PM
Rajan Singla
Rajan Singla - avatar
+ 1
Okay ,,,, Thank you a lot sir !! 😇
26th Mar 2018, 3:11 PM
Rajan Singla
Rajan Singla - avatar
0
an abstract class does not have a Constructor and can never be invoked while if it's not astract and you have many member and functions to inherit that some are and some aren't virtual. the class can be invoked as it's own while being able to use the non-virtual paremeters
2nd Apr 2018, 11:13 PM
sean demers
sean demers - avatar