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

3 Answers

Micah Hack
Micah Hack
12,902 Points

By quickly looking at the snapshot I can see that you had a typo for "firstName". Your code: String firtsName = "dan"; I'm always making mistakes like this especially when it comes to the camel casing.. Using an IDE sure has helped big time, lol.

daniel horan
PLUS
daniel horan
Courses Plus Student 1,441 Points

thanks for reply i actually noticed that after i sent this question and i fixed it but it still doesn't work. any other ideas as to why?

Micah Hack
Micah Hack
12,902 Points

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 = console.readLine("What is your name?  ");
  //thisIsAnExampleOfCamelCasing
  console.printf("Hello, my name is %s\n", firstName);
  console.printf("%s is learning to write Java\n", firstName);        

} }

Here is my code for reference. Are you sure that you are entering the correct commands in the console when you attempt to compile and run the code? First command should be: javac Introductions.java to compile the code and then: java Introductions to run it. Hope this helps! I have a habit of always entering "clear && javac Examplefile.java && java Examplefile" in the console to clear the console, compile, and run all in one go.