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 Data Structures 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,520 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.