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 Data Structures - Retired Organizing Data Arrays

Aditya Puri
Aditya Puri
1,080 Points

Error

My code was working ok earlier but when I added this code I didn't get the same error as him..heres the code added and the diff. error. Please help

http://prntscr.com/crcctb

1 Answer

Seth Kroger
Seth Kroger
56,413 Points

From the little you've shown your treets array is outside the scope of secondTreet which you're trying to assign as the second element. secondTreet doesn't exist at that point anymore.

Aditya Puri
Aditya Puri
1,080 Points

nvm i accidentally put the code outside my main method :\