Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Java Java Data Structures Getting There Packages

java data structures packages task 1

Not sure what to do. I know the import line usually goes at the top, but that is the line where code was supposed to go.

com/example/BlogPost.java

Display.java
public class Display {
  public static void main(String[] args) {
    import com.example.BlogPost.java; 

  }
}

3 Answers

Simon Coates
Simon Coates
28,692 Points

blogpost starts:

package com.example;

By the time you do the import, the code looks like:

package com.example;

public class BlogPost {

}

and

import com.example.BlogPost;

public class Display {
  public static void main(String[] args) {

  }
}

The comment about code goes here is presumably for task 4.

Simon Coates
Simon Coates
28,692 Points

when i originally posted the above, i hadn't set the BlogPost class to public. I apologize if this caused any problems.

package com.example;

public class BlogPost {
}

import com.example.BlogPost;

public class Display {
  public static void main(String[] args) {

    // Your code here...

  }
}

This is what I tried but I still got the error Bummer! Remember use the package keyword on the first line

package com.example;
import com.example.blogPost;

was just meant to be put under the com/example/BlogPost.java tab in case anyone's having the same problem.