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 Object-Oriented Programming Instantiation

Tojo Alex
PLUS
Tojo Alex
Courses Plus Student 13,331 Points

I don't know what it means

I don't know what it means when it says : Did you instantiate the Frog class using the 'new' keyword? i have made the variable mike and made the class frog but i don't know what i did wrong.I also don't know what script i have to work in the Program script or the frog script.

Program.cs
namespace Treehouse.CodeChallenges
{
    class Program
    {
        static void Main()
        {            
           var mike();


        }
    }
}
Frog.cs
namespace Treehouse.CodeChallenges
{

 class Frog{


     static void Main{        



     var mike();

              }

        }

   }

2 Answers

Justin Horner
STAFF
Justin Horner
Treehouse Guest Teacher

Hi Tojo,

To pass the first task of the challenge, the Frog class does not need to have instance variables or methods. It simply needs to be an empty class like this.

namespace Treehouse.CodeChallenges
{
    class Frog
    {
    }
}

The second task of the challenge wants you to create a variable with a value of a new Frog instance in Program.cs. You need to create a new variable and assign it the value of a new Frog instance. A new Frog instance can be created using the new keyword, like this

var frog = new Frog();

I hope this helps.

Tojo Alex
PLUS
Tojo Alex
Courses Plus Student 13,331 Points

i also noticed that it should be var mike =new Frog ();

Justin Horner
Justin Horner
Treehouse Guest Teacher

You're welcome! You got it. The challenge expects the variable name to be mike.