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 trialmelissakeith
3,766 Pointsjava 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.
public class Display {
public static void main(String[] args) {
import com.example.BlogPost.java;
}
}
3 Answers
Simon Coates
28,694 Pointsblogpost 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.
melissakeith
3,766 Pointspackage 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
melissakeith
3,766 Pointspackage 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.
Simon Coates
28,694 PointsSimon Coates
28,694 Pointswhen i originally posted the above, i hadn't set the BlogPost class to public. I apologize if this caused any problems.