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

Aaron Folborg
PLUS
Aaron Folborg
Courses Plus Student 501 Points

It says file does not contain class com.example.BlogPost. For task 4. But I had no errors during task 3

It's having trouble with the package. It's not finding the files that hold the .java file. It shows an error on the import but it worked for task 3 but on task 4 its saying not found.

com/example/BlogPost.java
public 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

Mohammad Laif
PLUS
Mohammad Laif
Courses Plus Student 22,297 Points

remove the public keyword before package keyword

public package com.example;

public class BlogPost
{

}

it happens to me too ?