C# C# Objects Object-Oriented Programming Initialization

Matthew Tyler
Matthew Tyler
653 Points

ive watched the last video about 3 times now. i still dont know how to do this

I'm meant to "Use the constructor to initialize the TongueLength field to the value passed in." but I have absolutely no idea

Frog.cs
namespace Treehouse.CodeChallenges
{
    class Frog
    {
        readonly public int TongueLength;
        public Frog (int length)
        {
            TongueLength = length;
        }
    }
}

1 Answer

Jennifer Nordell
STAFF
Jennifer Nordell
Treehouse Staff

Hi there, Matthew Tyler! I think we're going to have to agree to disagree here because it looks to me like you know exactly what you're doing. In fact, when I copy/paste your code into the challenge it passes all steps, which begs the question why it's not passing for you. My best guess is that there is some kind of caching problem here (either client-side or server-side) that is causing the issue. I might suggest clearing your browser cache, shutting down the browser, you might have to even log out of Treehouse and log back in (in case it's cached server-side) because your code straight-up passes!

Hope you get this sorted! :sparkles:

Matthew Tyler
Matthew Tyler
653 Points

oh, that's strange, i tried putting that in and it didnt work, but it does now, sorry to bother you!