Java Java Basics Getting Started with Java IO

Devin Cook
Devin Cook
313 Points

Variable declaration

Am I supposed to declare the variable as type console here and set firstName = to the input from the user?

IO.java
// I have imported java.io.Console for you.  It is a variable called console.

console firstName;

firstName = console.readLine;

1 Answer

Take a look at lines 6 and 8 of this video, it may be worth it to copy the code of each lessons by hand too: https://teamtreehouse.com/library/receiving-input-2