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 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
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

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!