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

Sankeit Dighe
Sankeit Dighe
203 Points

showing error inspite of me referring and conforming code with the video

i am not understanding the problem that java tester is showing as an error inspite of me checking and referring the video having the same code. i am kinda in a fix

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


public class Introductions {

    public static void main(String[] args) {
        Console console = System.console();
      String firstName = "Sanket";
      console.printf("Hello, My name is %s",firstName);
      console.printf("%s is learning Java",firstName);
        // Welcome to the Introductions program!  Your code goes below here

  }
}

1 Answer

Domenic Carobine
Domenic Carobine
9,014 Points

Hey, you don't need all that extra code to pass this code quiz. I tried the following code and it passed the quiz.

String firstName = "Sanket";
console.printf("Sanket can code in Java!");
console.printf("%s can code in Java!", firstName);
Sankeit Dighe
Sankeit Dighe
203 Points

Thank You for your help..!