Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Java Java Objects Delivering the MVP Review Arrays

casey echternacht
casey echternacht
1,782 Points

the answer for this question is wrong

it is unclear what the array is. I believe it is [java, helloworld, luke, skywalker]

whether "java" is considered part of the array or not, the correct answer is not listed.

The correct answer is either "helloworld" or "luke"

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there, casey echternacht ! No, the question is not wrong. When you run the command that is given in the console:

java HelloWorld Luke Skywalker

java is the command to run the file. HelloWorld is the name of the Java class. It's telling it which class to run. The args array is anything that comes after the class name. So the array would be ["Luke", "Skywalker"]. The string at the index of 1 of args then, is "Skywalker".

Hope this helps! :sparkles: