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

Java Java Arrays Iteration Multidimensional Arrays

Michel Spaniolo
PLUS
Michel Spaniolo
Courses Plus Student 1,850 Points

I keep getting an error in jshell..i just copied pasted notes, and it seems to say im missing a curly bracket} .

https://w.trhou.se/uj15x838wn...I dont see the error..maybe you got a clue.

1 Answer

chris101
chris101
1,071 Points

You forgot to add comma's after each array. So I guess thats what you'd call a syntax error? B-)

This is what your code currently looks like:

int[][] scoreCards = {
 // Ben's
{1, 2, 4, 2, 6, 5, 4, 3, 3, 2, 5, 7, 2, 7, 8, 4, 3, 2}
// Alena's
{2, 3, 5, 1, 1, 2, 3, 1, 1, 2, 4, 1, 3, 3, 2, 6, 3, 2}
// Pasan's
{4, 4, 2, 1, 2, 2, 1, 4, 2, 2, 2, 3, 2, 5, 8, 1, 2, 2}
};

This is what your code should look like with propper syntax:

int[][] scoreCards = {
 // Ben's
{1, 2, 4, 2, 6, 5, 4, 3, 3, 2, 5, 7, 2, 7, 8, 4, 3, 2},
// Alena's
{2, 3, 5, 1, 1, 2, 3, 1, 1, 2, 4, 1, 3, 3, 2, 6, 3, 2},
// Pasan's
{4, 4, 2, 1, 2, 2, 1, 4, 2, 2, 2, 3, 2, 5, 8, 1, 2, 2}
};

I know i'm very late to the problem, but perhaps this will save someone else in the future ¯_(ツ)_/¯