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

Compiler was mistaken i guess

i couldn't see my mistakes but compiler said that Did you crate new EatFly method bla bla ,thanks

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

        public Frog(int tongueLength,int reactionTime)
        {
            TongueLength = tongueLength;
            ReactionTime=reactionTime;
        }
        public bool EatFly(int distanceToFly , int flyReactionTime)
        {
            return TongueLength>= distanceToFly && ReactionTime<=flyReactionTime;
        }

        public bool EatFly(int distanceToFly)
        {
            return TongueLength >= distanceToFly;
        }
    }
}
Antonio Rodrigues
Antonio Rodrigues
2,306 Points

Could you post the exact exception message ?

1 Answer

Steven Parker
Steven Parker
222,348 Points

You're going to love this...

Apparently, the challenge does not like the space between distanceToFly and the comma in the parameter list.

:point_right: Remove that space to pass the challenge.

You may want to report this one as a bug on the Support Page. It might even get you the "special Exterminator badge".

i pressed the check button 4 or 5 times and it worked :D