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

Christopher Mlalazi
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Christopher Mlalazi
Front End Web Development Techdegree Graduate 17,305 Points

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

My code is now working I don't know where I got it wrong as I followed all steps:

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);

  }
}

2 Answers

andren
andren
28,558 Points

The code checker for these tasks is not always perfect, it will sometimes let some mistakes through some of the tasks and then choke on them later on. In this case the error in your code was made in the first task. There should be a space between the package keyword and com.example, not a dot like you have in your code. Like this:

package com.example;

If you fix that then your code will pass the challenge.