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 trialKevin Faust
15,353 Pointscode is not attached tho
3 Answers
Jesse Cochran
6,882 PointsTry putting your import statement above your Display class.
Next you need a name for your new BlogPost instance.
BlogPost blog = new BlogPost();
Additionally, your printf statement does not have an argument for %s.
For example, if you had a method getTitle() for a BlogPost object (blog), and you wanted to put the BlogPost title as the argument, you would do something like this....
System.out.printf("This is a blog post: %s", blog.getTitle());
Hope this helps!
Jason Anello
Courses Plus Student 94,610 Pointschanged from comment to answer
In this case the BlogPost class is empty so you should only pass in the BlogPost object.
Casey Huckel
Courses Plus Student 4,257 PointsCode's attached here:
public class Display {
public static void main(String[] args) {
BlogPost = new BlogPost();
System.out.printf("This is a blog post: %s");
// Your code here...
import com.example.BlogPost;
}
}
Kevin Faust
15,353 Pointsyou should probably rewatch the past lessons if you dont know where to put an import or how to create objects...
Priyesh Tungare
13,168 PointsThe import statement should be the first statement in your code.
Casey Huckel
Courses Plus Student 4,257 PointsMy error is "cannot find symbol." Here's my latest code: import com.example.BlogPost; public class Display { public static void main(String[] args) { // Your code here... BlogPost blog = new BlogPost(); System.printf("This is a blog post: %s", blog); } }
Kevin Faust
15,353 PointsYou wrote System.printf. It's System.out.printf
Jason Anello
Courses Plus Student 94,610 PointsJason Anello
Courses Plus Student 94,610 PointsHi Casey,
I believe the checkbox to attach your code is currently having a problem. Can you post the code you're trying?