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

My answer is correct...

Is this not right?

Name.java
// I have setup a java.io.Console object for you named console

 String firstName = "Brayden";

console.printf("%s can code in Java!");
ad15
ad15
2,200 Points

You forgot to specify what %s should refer to...

1 Answer

Tyler Andal
Tyler Andal
5,472 Points
// I have setup a java.io.Console object for you named console
String firstName = "Tyler";
System.out.printf(firstName + " can code in Java!");
Tyler Andal
Tyler Andal
5,472 Points

In my example above it will pass challenge 2 of 3.

The code below will allow you to pass challenge 3 of 3 which is what you may be trying to complete. I hope this helps you out.

// I have setup a java.io.Console object for you named console
String firstName = "Tyler";
System.out.printf("%s can code in Java!", firstName);