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# 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
231,236 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