Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Java Java Objects Meet Objects Creating Classes

Michel Spaniolo
PLUS
Michel Spaniolo
Courses Plus Student 1,850 Points

my workspace keeps giving me back errors that arent there when compiing running java

public class Example {

public static void main(String[] args) { // Your amazing code goes here... Sytem.out.println("We are making a new pez dispensor"); PezDispenser dispenser = new PezDispenser(); System.out.printf("The dispenser is %s %n, dispenser.characterName);

}

} MY CODE IS ABOVE .....WORKSHOP BELOW System.out.printf("The dispenser is %s %n,
^
Example.java:7: error: ';' expected
System.out.printf("The dispenser is %s %n,
^
Example.java:8: error: illegal start of expression
dispenser.characterName);
^
Example.java:8: error: ';' expected
dispenser.characterName);
^
4 errors
treehouse:~/workspace$ ^C
treehouse:~/workspace$
public class Example {

Steven Parker
Steven Parker
216,012 Points

Code should be complete and properly formatted. Take a look at these videos about Posting a Question, using Markdown formatting to preserve the code's appearance., and particularly this one about sharing a snapshot of your workspace.

Try saving before compiling.

Sytem should be System in Sytem.out.println("We are making a new pez dispensor");