Ask coding questions

← Back to all posts
Error CS0144 with Abstract Classes
AureyLia

I understand that I can't create an object of an abstract class... but how do I fix this problem?

Voters
AureyLia
Comments
hotnewtop
SixBeeps

Sports should be the only abstract class, but you've marked its subclasses as abstract as well. Make them not abstract to instantiate them.

AureyLia

Thanks, the only problem that I can't figure out now is the error I'm getting because my classes ShotPut and Rugby don't implement the Sport.Play() method. How would I fix this? Thank you so much btw.

SixBeeps

@AureyLia You still need to mark Play() as override functions