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 Data Structures - Retired Getting There Packages

Dakota Strege
Dakota Strege
3,005 Points

Blog vs blog problems... 4of4...

public class Display {
  public static void main(String[] args) {
    // Your code here...
BlogPost blog= new blog();

  System.out.printf("This is a blog post: %s", blog);
  }
}

How can I get rid of this error?

./Display.java:6: error: cannot find symbol
BlogPost blog= new blog();
                                  ^
  symbol:   class blog
  location: class Display
1 error

(the caret is highlighting the "b" in the "new blog")

[MOD: edited code blocks and caret - srh]

1 Answer

andren
andren
28,558 Points

The word following new has to be the name of the class being instantiated. Since the name of the class is BlogPost it is incorrect to use the word blog.

If you change it to BlogPost like this:

BlogPost blog = new BlogPost();

Then that should fix the error you are receiving.