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!

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 and Variables

on my console in my workspace it always printout that "my name is craig" despite i have changed my code

what might be the problem

5 Answers

Hi there,

Have you saved & recompiled your Workspace?


I did several times I wonder whats wrong

Strange - can you share your Workspace so I can fork it and see what might be the problem. (click the "camera" top-right)


i have taken snapshot how should i share here

The snapshot gives you a link in the new window (its URL) - paste that in here. That lets me see your code but not amend it. I can then fork the Workspace to amend it.


Hi Roshaan,

I think your compiling should fail so your runtime/compiled code won't be changed until the compile is successful. It will fail because String needs a capital letter.

Change that and the compile should happen which will amend/update your runtime/compiled code.


public class Introductions {

    public static void main(String[] args) {
        Console console = System.console();

        string firstname="roshaan"; // <- that won't compile

        console.printf("Hello, my name is %s\n",firstname);
        console.printf("%s is am learning java\n",firstname);

yeah thanks steve

No problem! :smile: