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 Getting There Packages

Casey Huckel
PLUS
Casey Huckel
Courses Plus Student 4,257 Points

What's wrong here?

Code should be attached

Hi Casey,

I believe the checkbox to attach your code is currently having a problem. Can you post the code you're trying?

Kevin Faust
Kevin Faust
15,353 Points

code is not attached tho

3 Answers

Jesse Cochran
Jesse Cochran
6,882 Points

Try putting your import statement above your Display class.

Next you need a name for your new BlogPost instance.

BlogPost blog = new BlogPost();

Additionally, your printf statement does not have an argument for %s.

For example, if you had a method getTitle() for a BlogPost object (blog), and you wanted to put the BlogPost title as the argument, you would do something like this....

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

Hope this helps!

changed from comment to answer

In this case the BlogPost class is empty so you should only pass in the BlogPost object.

Casey Huckel
PLUS
Casey Huckel
Courses Plus Student 4,257 Points

Code's attached here:

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

you should probably rewatch the past lessons if you dont know where to put an import or how to create objects...

Priyesh Tungare
Priyesh Tungare
13,168 Points

The import statement should be the first statement in your code.

Casey Huckel
PLUS
Casey Huckel
Courses Plus Student 4,257 Points

My error is "cannot find symbol." Here's my latest code: import com.example.BlogPost; public class Display { public static void main(String[] args) { // Your code here... BlogPost blog = new BlogPost(); System.printf("This is a blog post: %s", blog); } }

Kevin Faust
Kevin Faust
15,353 Points

You wrote System.printf. It's System.out.printf