Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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: