C# C# Objects Object-Oriented Programming Initialization

Use the constructor to initialize the TongueLength field to the value passed in.

Initialization namespace Treehouse.CodeChallenges { class Frog { public readonly int TongueLength; public Frog(int TongueLength) {

    }

 }

}

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

        }

     }
}

1 Answer

Shaun Barbour
PRO
Shaun Barbour
Pro Student 1,901 Points

Hey Winston. Simply add the following to the constructor:

TongueLength = tongueLength;

Hope this helps!

Cheers!