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 trialChris Cherenegar
321 Pointswhy is my error pointing at public class?
The notes indicate the object was already created, but I'm still getting an error. What am I doing wrong.
// I have setup a java.io.Console object for you named console
public class Name {
public static void main(Strings [] args)
{
String Name = "Shazdeh";
system.Console("My name is %s\n", Name);
}
}
2 Answers
Kristian Terziev
28,449 PointsIt good that you had the idea to use classes, however, here you're just required to declare a variable. No classes, no main functions, nothing. Just a simple line. Make sure you follow the conventions for camelCasing // don't start a variable with an upper case.
One more thing, when using a console object, use only console.printf, rather than system.Console
Chris Cherenegar
321 Pointsgreat thank you! I make things far too difficult
Harry James
14,780 PointsHarry James
14,780 PointsMarking this as the Best Answer as asker has confirmed it has fixed the issue :)