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 trialchenzhang4
Courses Plus Student 916 Pointsstatement unexpected. Did anyone encounter the same here?
For the print
2 Answers
Tyler Combs
15,525 PointsThe problem is your console.printf{}
method. Methods that take parameters or arguments use parentheses, not curly braces. ;)
Tyler Combs
15,525 PointsIf you copy/paste the error you received and your code, or used Workspace's Snapshot feature, it'd be a lot easier for someone to understand what the problem is and offer help. As of right now, there's not enough to go off of in order to give any advice.
chenzhang4
Courses Plus Student 916 PointsPicked up JAVA_TOOL_OPTIONS: -Xmx128m
Picked up _JAVA_OPTIONS: -Xmx128m
Introductions.java:8: error: not a statement
console.printf{"here"};
^
Introductions.java:8: error: ';' expected
console.printf{"here"};
^
Introductions.java:8: error: not a statement
console.printf{"here"};
^
Introductions.java:8: error: ';' expected
console.printf{"here"};
^
4 errors
code here:
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
console.printf{"here"};
} }