0

Drawing Application

Can someone help me, what is wrong with my code ? using System; using System.Collections.Generic; namespace Code_Coach_Challenge { class Program { static void Main(string[] args) { Draw pencil = new Draw(); Draw brush = new Brush(); Draw spray = new Spray(); pencil.StartDraw(); brush.StartDraw(); spray.StartDraw(); } } /* Draw => "Using pencil" Brush => "Using brush" Spray => "Using spray" */ public interface IDraw { void StartDraw(); } class Draw : IDraw { public virtual void StartDraw() { Console.WriteLine("Using pencil"); } } //inherit this class from the class Draw class Brush : Draw { //implement the StartDraw() method public override void StartDraw(); { Console.WriteLine("Using brush"); } } //inherit this class from the class Draw class Spray : Draw { //implement the StartDraw() method public override void StartDraw(); { Console.WriteLine("Using spray"); } } static void Main(string[] args) { Draw p = new Draw(); p.StartDraw(); Brush b = new Brush(); b.StartDraw(); Spray s = new Spray(); s.StartDraw(); } }

8th Feb 2021, 5:29 PM
Vini Souza
Vini Souza - avatar
1 Odpowiedź
+ 1
You have 2 Main methods. Delete the 2nd one that you added and use the 1 that was provided.
8th Feb 2021, 10:22 PM
ChaoticDawg
ChaoticDawg - avatar