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 Basics Using your New Tools Multiple Format Strings

Ijeoma Iheke
Ijeoma Iheke
205 Points

I'm trying to complete Task 3 of Multiple.java challenge, and I'm getting errors and not sure what it's asking

This is what I wrote for the answer, and someone help figure out what I'm doing wrong? console.printf("%s really %s", name, verb);

Also, my workshop template is giving me errors on both of the exercises. It didn't perform and of the tasks, even though I had the same thing the instructor had on his worksheet. I just keep getting error messages, can someone please help.

Multiple.java
// I've imported java.io.Console for you.  It is stored in a variable called console for you.
String name =console.readLine("Enter your name:  ");
String pastTenseVerb = console.readLine("Enter your name:  ");
console.printf("%s really %s", name, verb);

2 Answers

The verb in printf should be pastTenseVerb.

Ijeoma Iheke
Ijeoma Iheke
205 Points

Thank you Joseph for your response.

I did try that before and I just tried it again, and below is the error that I'm getting, and suggestions? I also changed question 2 to pastTenseVerb, which was correct.

console.printF("%s really %s", name, pastTenseVerb); error msg: JavaTester.java:118: error: cannot find symbol Console.printF("%s really %s", name, pastTenseVerb); ^ symbol: variable Console location: class JavaTester 1 error

Thank you in advance for your help.

Ijeoma Iheke
Ijeoma Iheke
205 Points

Thank you so much, that did it.

Per chance do you know what I can do to get my tasks on Workspace to perform. I always get error messages when I try to execute the tasks (on both workspaces).

You have typos for both attempts.

  1. printF for both attempts should be printf (note the lower case f).
  2. Console for the second attempt should be console.