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
chase singhofen3,811 Points
console.printf("Last name: %s", lastName);
i cant figure out why this cant compile??
i need to print my last name string variable. previous question is same except for print last name instead of first name.thx
// I have imported java.io.Console for you. It is a variable called console. // I have imported java.io.Console for you. It is a variable called console. String firstName = console.readLine(); String lastName = console.readLine(); console.printf("Last name: %s", lastName);
Jason AndersTreehouse Moderator 145,855 Points
Well, your code is correct, except the code for Task 3 seems to have been deleted?
When working in code challenges, unless explicitly told otherwise by the Task's instructions, all subsequent code for tasks must be added to what you have inputed from previous tasks.
So, just put back in the code from Task 3, and add the code for Task 4 under the previous code, and it will all pass.
Keep Coding! :)