Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

C# C# Objects Methods Method Overloading

Jeongeui Ji
Jeongeui Ji
3,761 Points

cant totally understand the question

I added the field in the first question and then in the second one, I do not understand whether I am to add another class or constructor... Can anybody help me please?

Frog.cs
namespace Treehouse.CodeChallenges
{
    class Frog
    {
        public readonly int TongueLength;

        public Frog(int tongueLength)
        {
            TongueLength = tongueLength;
        }

        public bool EatFly(int distanceToFly)
        {
            return TongueLength >= distanceToFly;
        }
        public readonly int ReactionTime;

        public reactionTIme(int ReactionTime)
        {
            reactionTime = Reactiontime;
        }

    }
}

1 Answer

Steven Parker
Steven Parker
220,415 Points

Task 2 says: "Add a second parameter to the constructor ..."

But it looks like you added an entire new method named reactionTIme.

Remember, the constructor of a class always has the same name as the class itself. So for this task, you will be adding another argument to the existing constructor Frog, and another line of code inside it.