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 Basics Getting Started with Java Introduction to Your Tools

Line 6: Why "Console console"? Why is the word repeated?

Sorry for this stupid question. Thanks for your help...

2 Answers

You use 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 String.

The second 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 console.

You should worry too much about this, this will be covered in depth in a future video/course. :smile:

I hope this helps :grin:

Happy coding! :tada:

:dizzy: ~Alex :dizzy:

james south
.a{fill-rule:evenodd;}techdegree seal-36
james south
Front 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.