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

Now in the main method of Display.java, instantiate a new BlogPost. -- Issue

Display.java
import com.example.BlogPost;

public class Display {
  public static void main(String[] args) {
  BlogPost myBlogPost = new BlogPost();
    System.out.printf("this is a blog post : %s %n", blogPost);

  }
}

com/example/BlogPost.java

package import com.example;
public class BlogPost(){
}

Answer I'm sure is simple, minds drawing a blank.

1 Answer

Hi Dillon,

You've created a new instance correctly:

BlogPost myBlogPost = new BlogPost();

Then you reference a different instance in the subsequent line:

System.out.printf("this is a blog post : %s %n", blogPost);

So, you can either change myBlogPost to blogPost or the other way round.

Steve.