- #1
FallenApple
- 566
- 61
So what is the purpose of an Abstract Class? Can I not get the same things by doing subclasses?
For example. I can create a class called Vector_Space and then a subclass called Euclidean_Space
We all know that Euclidean space is just a particular type of vector space. So I can just write the program once for Vector_Space and then just code in the extra stuff for Euclidean_Space
So why would I want an abstract class when I can just do the abstraction by inheritance instead? I can just chain the inheritance until I've abstracted away most of the structure.
As an example,
...Group->...Module->Vector_Space->Euclidean_Space
For example. I can create a class called Vector_Space and then a subclass called Euclidean_Space
We all know that Euclidean space is just a particular type of vector space. So I can just write the program once for Vector_Space and then just code in the extra stuff for Euclidean_Space
So why would I want an abstract class when I can just do the abstraction by inheritance instead? I can just chain the inheritance until I've abstracted away most of the structure.
As an example,
...Group->...Module->Vector_Space->Euclidean_Space