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 trial

Java Java Basics Using your New Tools Coding the Prototype

Bobby Hook
Bobby Hook
744 Points

non static error print

line 33 saying non static error print (string,object... cannot be referenced from static object. with a marker under the word name. it only show one error (line 33 is the line with the star in brackets)

String name = console.readLine("What is your name? "); String famous = console.readLine("Pick someone famous: "); String place = console.readLine("What is your favourite place? "); String meal = console.readLine("What is your favourite food? "); String feeling = console.readLine("Pick a feeling: "); String drink = console.readLine("What is your favourite drink? \n\n");

  console.printf("\n \n -------------------%s's Story--------------------\n \n", name);

  console.printf("One day in August %s was called be %s and %s asked if %s wanted to go for a nice meal. %s said yes i would love to go so %s picked up %s \n", name, famous, famous, name, name, famous, name);

((*)) Console.printf("They went to %s where they ate %s until %s felt really %s.", place, meal, name, feeling);

  console.printf("After %s felt really %s %s took %s home and they had some really nice %s and %s was so happy!", name, feeling, famous, name, drink, name);

1 Answer

In the line you indicate has the error, you have Console capitalized. You should be using "console.printf()", with a lower case c, as you did everywhere else.

Bobby Hook
Bobby Hook
744 Points

I cannot believe im so stupid to miss that! I was staring at the code for ages. Thanks