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 trialMariya Shklyar
1,022 PointsI'm on a second lesson of Java basics Strings and Variables. I was trying to console, but it gives me a error.
error: reached end of file while parsing
4 Answers
Cindy Lea
Courses Plus Student 6,497 PointsPlease post the code.
Mariya Shklyar
1,022 Pointshttps://teamtreehouse.com/workspaces/07ojppsulm/fork
console.printf("Hello, my name is Mariya"); console.printf ("Mariya is learning how to write Java");
alex33242 we
Courses Plus Student 555 PointsMy code is import java.io.Console;
public class MyConsole {
public static void main(String[] args) {
String firstName ="Alex";
Console console = System.console();
console.printf("%s can code in Java!", firstName);
}
}
But i got error is in eclipse Exception in thread "main" java.lang.NullPointerException
at MyConsole.main(MyConsole.java:6) line 6 is printing line.
Eric Esparza
328 PointsMariya,
Make sure you save the code before compiling in the console.
Eric
Martin Smith
Courses Plus Student 467 PointsMartin Smith
Courses Plus Student 467 PointsI tried doing the same thing and didn't get any errors, are you sure you closed your parenthesis?