Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C# Intermediate C# Polymorphism Virtual Methods

Anusha Singh
PLUS
Anusha Singh
Courses Plus Student 22,106 Points

I did not really understand what to do in this

Subclass the SequenceDetector class call the new class RepeatDetector. Can you help me out here?

SequenceDetector.cs
namespace Treehouse.CodeChallenges
{
    class SequenceDetector : base 
    {
        public virtual bool Scan(int[] sequence)
        {
            return true;
        }
    }
}
RepeatDetector.cs

1 Answer

Steven Parker
Steven Parker
231,248 Points

If you don't know how to even begin a challenge, it might be a good time to review a lesson or two.

The process of subclassing is presented in the Virtual Methods video. Your task here of using "SequenceDetector" to create "RepeatDetector" is very similar to the where the video uses "Invader" to create "ShieldedInvader".