C# C# Objects Object-Oriented Programming Initialization

initialization

Help on the below code Use the constructor to initialize the TongueLength field to the value passed in.

namespace Treehouse.CodeChallenges { class Frog { public int TongueLength; public Frog(int TongueLength) { Frog frog = new Frog();
Frog.TongueLength = int
}

}

}

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

    }
}

1 Answer

Shaun Barbour
PRO
Shaun Barbour
Pro Student 1,901 Points
namespace Treehouse.CodeChallenges
{
    class Frog
    {
        public readonly int TongueLength;

        public Frog(int tongueLength)
        {
            TongueLength = tongueLength;
        }
    }
}