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 trialMartez Hall
878 Pointscom/example/BlogPost.java
I cant understand the problem with this code isn't the package statement on the first line but it keeps tell me to, "Make sure you keep the package statement on the first line. There seems to be some problems, use preview to see the compilation errors." When I look it keeps telling me that the creation date variable is the problem but I don't see anything wrong. Helllppppp!!!!
package com.example;
import java.util.Date;
public class BlogPost {
private String mAuthor;
private String mTitle;
private String mBody;
private String mCategory;
private class Date mCreationDate;
}
}
3 Answers
George Pirchalaishvili
3,747 PointsWell i see couple of problems to be honest:
1) private class Date mCreationDate; - You should remove class since it is a variable
2) you have extra " } " sign
Victor Learned
6,976 PointsTry removing 'class' from your statement. The compiler things you are trying to declare a new class when really you just want to use a Date object.
private Date mCreationDate;
Craig Dennis
Treehouse TeacherYeah it's a little tricky, I had to include the package statement bit in the compilation warning. But the real problem is the aforementioned syntax errors.
Sorry for the confusion!