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 trial

Java Java Basics Getting Started with Java Strings, Variables, and Formatting

why it isnt working. even the console looks like isnt working

?

Name.java
// I have setup a java.io.Console object for you named console
String firstName="Yoni";
Console.Printf("<%s> can code in java",firstName);

1 Answer

andren
andren
28,558 Points

The console object and the printf method should both be written all in lowercase. Java like most programming languages is case-sensitive so Console and console are not treated as the same name.

Besides that the challenge does not actually want you have <> brackets inside of the string you print out, it just want you to insert the name with the %s placeholder.

You are also missing an exclamation point at the end of your string. While that won't actually cause an issue in this particular challenge it is pretty common for challenges to be extremely picky about strings, so you should always try to make the string as identical to the one asked for as possible.

Like this:

String firstName = "Yoni";
console.printf("%s can code in Java!", firstName);

thank u :)