What am I missing in drawing an application? I keep getting an error when I try to inherit an instance from the class | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What am I missing in drawing an application? I keep getting an error when I try to inherit an instance from the class

https://code.sololearn.com/c44bMevPwjs9/?ref=app

6th Jan 2021, 12:02 PM
eMBee
eMBee - avatar
4 Answers
+ 3
You have to use the override keyword. An override can't be virtual. You're not inheriting from the Draw class, you're implementing the IDraw interface.
6th Jan 2021, 12:15 PM
ChaoticDawg
ChaoticDawg - avatar
+ 2
Class Brush and class Spray should inherit from the Draw class and override the StartDraw() method.
6th Jan 2021, 12:09 PM
ChaoticDawg
ChaoticDawg - avatar
+ 1
Yea you're right ChaoticDawg Many thanks
6th Jan 2021, 12:20 PM
eMBee
eMBee - avatar
0
ChaoticDawg, yes you're right but even when I save the changes, it doesn't override the StartDraw() method
6th Jan 2021, 12:12 PM
eMBee
eMBee - avatar