I’m creating a class named TetraQueue that inherits System.Collections.Generic.Queue class overriding the Dequeue method, here is the code:
public class TetraQueue : Queue<Tetrablock> { public override Tetrablock Dequeue() { return base.Dequeue(); } }
But when I try to compile this I get:
Error TetraQueue.Dequeue()’: no suitable method found to override TetraQueue.cs
Thanks in advance.
How do I know if a method is virtual(to avoid this kind of situation)?
Unfortunately the
Dequeuemethod is not virtual so you can’t override it.