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
Anissa Ananda386 Points
Line 6: Why "Console console"? Why is the word repeated?
Sorry for this stupid question. Thanks for your help...
Alexander Davison65,469 Points
Console to tell the
type of the variable. In this case, we're making a new
Console, so we need to tell the type is
Console. If you are working with strings, the type would be
console is the name of the variable, but it doesn't have to be called
console. In fact you can call it whatever you want, but in this case it makes most sense to call it
You should worry too much about this, this will be covered in depth in a future video/course.
I hope this helps
james southFront End Web Development Techdegree Graduate 33,271 Points
java does type checking and when variables are declared their type must be declared as well, so here Console is a type and the variable name is console. it can only hold type Console or you will get a compile error.