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

Elfar Oliver
Elfar Oliver
3,924 Points

I keep receiving this error: Frog.cs(17,21): error CS0111: A member `Treehouse.CodeChallenges.Frog.EatFly(int, int)' is

I honestly don't understand the problem

Elfar Oliver
Elfar Oliver
3,924 Points

I have no idea why my code isn't there. But I asked for help in the same tab I had the assignment open so when I opened the exercise again I had to redo the whole thing because my code was still up but it didn't fit the criteria for exercise 1 of 3 so I copied and cut the code I couldn't work out and reapplied it and then it just worked. It's done

Elfar Oliver
Elfar Oliver
3,924 Points

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)
    {
        return TongueLength >= distanceToFly;
    }

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

}

Steven Parker
Steven Parker
231,236 Points

If you no longer have a problem, you can click the little rectangle with the 3 dots to reveal the option to "Delete Question".