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

Help

Getting really frustrated not sure what the problem is please give me some help here and do not just give me the answer I want to understand what the heck I am doing wrong lol

com/example/BlogPost.java
package com.example;

public class BlogPost {

}
Display.java
import com.example.BlogPost;

public class Display {
  public static void main(String[] args) {
    // Your code here...
    BlogPost blogpost = new BlogPost();
    System.out.printf("This is a blog post: %s", BlogPost);
  }
}

1 Answer

You're using a wrong variable when calling the printf method. You use the class name instead of the variable name. Make sure you go back and review classes if needed. Craig does amazing job explaining them. I've also did some explanation myself here: https://teamtreehouse.com/forum/unfortunately-the-app-has-stopped-working-2

So it should be System.out.printf("This is a blog post: %s", display); ???

I think that is right but I think that the problem is where I tried to instantiate a new BlogPost

Not really. It should be:

BlogPost blogPost = new BlogPost();
System.out.printf("This is a blog post: %s", blogPost);

I STRONGLY recommend you open the link I provided and also go back in videos. It seems you have quite the issue with classes. They are the core of java so you MUST clear that problem.

Will do thank you for the guidance