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!

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 Encapsulation and Arrays Arrays

I don't understand why this line of code is failing?

I'm pretty sure this line of code for : Set the first double in the array to 2.2 is correct. I'm getting the error:" Bummer! Did you index into the first element?" but the first element IS set??

I googled the answer on another identical question and this is the correct code as far as I can tell? https://teamtreehouse.com/community/set-the-first-double-in-the-array-to-22

double[] lapTimes = new double[4];
lapTime[0] = 2.2;

2 Answers

28,554 Points

You just have a small typo.

On the second line you have typed lapTime instead of lapTimes (you forgot the last s) if you add that like this:

double[] lapTimes = new double[4];
lapTimes[0] = 2.2;

Then your code will be accepted.


thank you