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 trialCalvin Secrest
24,815 PointsConvert the NumFliesEaten property to the simpler auto-property.
I'm not sure why it doesn't compile when I declare NumFliesEaten property
namespace Treehouse.CodeChallenges
{
public class Frog
{
private int _numFliesEaten { get; set; }
}
}
2 Answers
Calvin Secrest
24,815 PointsThank you for your answer
kathyvuong
9,299 PointsShould try this.:
Convert the NumFliesEaten property to the simpler auto-property.
namespace Treehouse.CodeChallenges { public class Frog { public int NumFliesEaten { get; set; } } }
Christopher Cornish
13,772 PointsChristopher Cornish
13,772 PointsNeeded to set NumFliesEaten to public rather than private, and change _numFliesEaten to NumFliesEaten since it's now public.