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

The console gives the same output every time .. even though i save the code..

What am I doing wrong here? Only the "hello my name is jack " is shown in the console, nothing else .. why?

import java.io.Console;

public class Introductions {  
    public static void main(String[] args) {
        Console console = System.console();
        // Welcome to the Introductions program!  Your code goes below here
       String firstName="jack";
            //this is an example of CamelCasing
            console.printf("hello my name is jack %s\n", firstName);
            console.printf("%s is learning how to write java\n",firstName);
  }
}

Hi jack,

If I look the output should be :

hello my name is jack jack
jack is learning how to write java

Try to reload page

Hi Jack

If you have added second console statement later , have you recompiled the file again after saving it?