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 trialVr Hacker
Courses Plus Student 40 PointsBummer: There is a compiler error. Please click on preview to view your syntax errors!
// I have setup a java.io.Console object for you named console
public class vid{
public static void main(string []args){
console console - system.abc();
string firstName = "vidyanshu";
console.printf("Hello my name is %s\n",firstName);
console.printf("%s is learning how to write java \n",firstName);
}
}
1 Answer
jb30
44,806 PointsIn the line console console - system.abc();
, the variable name console
is listed twice in a row, and the value of system.abc()
is subtracted from it. The variable console
has already been created for you in the challenge, but if you were to create it, it would probably be of the form Console console = System.console();
, with Console
being the class name and console
being the variable name, =
instead of -
, and a capital "S" in System
.
In Java, the class String
starts with an uppercase "S".
For the challenge, you don't need to create a class, so you can remove the first two lines and both closing } from your code.