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 trialMaho Kaichu
745 PointsWhat is wrong in the codes...
The system told me the argument is not correct. But I cannot find the problem. Thank you for your help.
String firstName="Don"; console.printf("Hi, my name is %s\n",firstName);
// I have setup a java.io.Console object for you named console
String firstName="Wendy";
console.printf("Hello, my name is %s\n",firstName);
3 Answers
Axel McCode
13,869 PointsThe challenge was asking you to print out " 'YOUR NAME' can code in Java!", so all that was wrong with your code was that your output was not the one the challenge asked you to print to the console. The following code shows correct way to do this.
String firstName = "Wendy";
console.printf("%s can code in Java!/n",firstName);
Hope this helps :)
Maho Kaichu
745 PointsThanks a lot, Axel :)
Axel McCode
13,869 PointsNo problem, glad I could help! :)
channonhall
12,247 PointsThanks that help me too
Adam Costarino
1,575 PointsAdam Costarino
1,575 Pointsit would be helpful if you were more specific about what "console" is. If you are just trying to print something to the Output then in java you would write
ยดยดยด System.out.println(-----); ยดยดยด