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 trialSabrina Khan
192 Pointsit says illegal start of expression. What am I doing wrong?
public class Name { There is an arrow pointing to the word "public" but I don't know what I've done wrong.
public class Name {
public static void main(Strings[] args) {
Console console = system.console();
string firstName = "Sabrina";
console.printf ("Hello, my name is %s.\n ", firstName);
console.printf (" %s is a lovely name. \n ", firstName);
}
}
4 Answers
ISAIAH S
1,409 PointsHi Sabrina Khan,
When it says // I have setup a java.io.Console object for you named console
in code challenges, you don't need:
public class Name {
public static void main(Strings[] args) {
Console console = System.console();
}
}
Grigorij Schleifer
10,365 PointsI donΒ΄t know why you have an error here, but i found that you have a typo here
Console console = system.console();
string = "Sabrina";
I think System and String must be uppercase Console console = System.console(); String = "Sabrina";
Java is case sensitive ....
Shout out if i am wrong and how you fugured it out :)
Emily Cain
5,850 PointsHi Sabrina,
Try changing "public class Name {" to "class Name {" i.e. removing the initial "public."
Hope this helps!
Emily
Johan Delgado
5,484 PointsNeither of those help were useful I am having the same issue and could not solve it I am stuck in this question, if there is a better answer please I will do appreciate it.
Sabrina Khan
192 Pointstry deleting the first expressions and capitalizing the right words
Sabrina Khan
192 PointsSabrina Khan
192 PointsI took that all out and received "JavaTester.java:94: error: class, interface, or enum expected" as a continuous error
Sabrina Khan
192 PointsSabrina Khan
192 Pointsnope! youre right! I deleted the first expressions and capitalized "String"
ISAIAH S
1,409 PointsISAIAH S
1,409 PointsAlways happy to help!