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 trialCree Robinson
1,272 PointsHow do I assign a new object (object name: frog) to a variable (variable name: mike)?
Object has already been created using the following syntax
Frog frog = new Frog ();
namespace Treehouse.CodeChallenges
{
class Program
{
static void Main()
{
Frog frog = new Frog ();
var mike = frog;
//var frog = "mike";
}
}
}
namespace Treehouse.CodeChallenges
{
class Frog
{
}
}
1 Answer
Steve Agusta
6,221 PointsYou've got the right idea, but your instantiation of the variable is not quite correct. Can you think of other examples you've seen where an object has been instantiated? Would it be more like var mike = ?