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

Android Build a Simple Android App with Java Basic Android Programming Using the Random Class

Robert Rose
Robert Rose
517 Points

JavaTester.java:66: error: array required, but String found String intAsString = intAsString[randomNumber];

Please help.

1 Answer

akiva grobman
akiva grobman
9,160 Points

If I understood correctly it should be: String[] intAsString = intAsString[randomNumber]; Instead of: String intAsString = intAsString[randomNumber];

akiva grobman
akiva grobman
9,160 Points

You can actually see it in the error message. is says "array required, but String found". that tells you the compiler is looking for an array type but is receiving (finding) a String type. this will generally happen when you define the variable the wrong way or if you pass the wrong variable as a parameter.