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

String formatter

Can proceed
// I have setup a object for you named console
String firstName = "nkosi";
console.printf ("hello, my name is nkosi\n");
console.printf ("nkosi can code in Java\n", firstName );

1 Answer

You should try console.printf("Hello my name is %s %n", firstName); The %s is used for when you want to use variables. In this case firstName