+ 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 ??
6 Antworten
+ 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.
+ 3
An abstract class is polymorphism. Abstract classes implement in practice one of the principles of OOP - polymorphism.
+ 2
Yes
+ 1
your mean Abstraction = polymorphism ??
+ 1
Okay ,,,, Thank you a lot sir !! 😇
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