Java Java Data Structures Getting There Packages

Aaron Folborg
PRO
Aaron Folborg
Pro 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
PRO
Mohammad Laif
Pro Student 22,284 Points

remove the public keyword before package keyword

public package com.example;

public class BlogPost
{

}

it happens to me too ?