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 trialtushar beri
73 PointsI wrote the correct syntax but it shows the error
what should I do to remove error
// 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 ");
console.printf("%s is my name",name);
String pastTenseVerb=console.readLine("enter past tense verb");
console.printf("%s is the past tense verb",pastTenseVerb);
console.printf("\n %s really %s this coding exercise. ", name, pastTenseVerb);
tushar beri
73 PointsI got this error " Bummer! Make sure you are passing name
and pastTenseVerb
to the console.printf
in the correct order"
1 Answer
K Cleveland
21,839 PointsThe challenge asks you to output a sentence that takes both the name and past tense verb using a single statement.
console.printf("%s is the past tense verb",pastTenseVerb);
console.printf("\n %s really %s this coding exercise. ", name, pastTenseVerb);
It seems like this task will fail if there are multiple outputs.
Abu Muhariba
1,140 PointsAbu Muhariba
1,140 PointsI literally just copied and pasted your code and it worked...
What error are you getting?