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.

matt hackney
380 PointsHelp with Treestory.java
i need help! cant figure out the errors : Identifier needed and class, interface or enum needed
here is the code
import java.io.Console;
public class TreeStory {
int age = 12;
if (age < 13) {
//insert exit code
Console.printf ("sorry, you must be at least 13 to use this.\n")
system.exit(0);
}
String name = console.readLine("enter a name: ");
String adjective = console.readLine("enter an adjective: ");
String noun = console.readLines("enter a noun: ");
String adverb = console.readLines("enter an adjective: ");
String verb = console.readLine("enter a verb ending in -ing: ";
console.printf("Your TreeStory:\n------------------------\n");
console.printf("%s is a %s %s. ", name adjective, noun);
console.printf ("they are always %s %s.\n", adverb, verb);

Geoff Parsons
11,679 PointsI edited your post matt hackney to add syntax highlighting and preserve whitespace. :)
4 Answers

Dan Donche
6,214 PointsI think you might be missing a semicolon after your console.printf line:
Console.printf ("sorry, you must be at least 13 to use this.\n")

Michael Hess
24,511 PointsString verb = console.readLine("enter a verb ending in -ing: ";
It looks like you're missing a right parenthesis bracket, too.
Try: String verb = console.readLine("enter a verb ending in -ing: ");

Dan Donche
6,214 PointsYep, that too.

Craig Dennis
Treehouse TeacherI think you accidentally removed the main method....
import java.io.Console;
public class TreeStory {
//Missing this
public static void main(String[] args) {
//your code here
//...
// Need to close
}
// Need to close
}

matt hackney
380 Pointsthanks!
matt hackney
380 Pointsmatt hackney
380 Points(the structure changed when i pasted the code to the forum)