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 trialDerek Aldana
1,095 PointsAutoProperty Help
I am missing something. Am I supposed to create this property then make another class to call it with the auto property? I cant figure out how this is supposed to go. Never got auto-properties before.
namespace Treehouse.CodeChallenges
{
public class Frog
{
// private int _numFliesEaten;
public NumFliesEaten{get;set;}
// get { return _numFliesEaten; }
// set { _numFliesEaten = value; }
}
}
2 Answers
Steven Parker
231,198 PointsYou are only missing the property type.
Otherwise, you would have had it. Your new auto-property should have the same type as the previous private field did.
Derek Aldana
1,095 PointsOk gotcha. I was trying to get it from the previous video but I see now. Its gotta take in a int so the type will be int.