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 Class Review

Ronald Greer
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Ronald Greer
Front End Web Development Techdegree Graduate 56,280 Points

task 3 of class review and i am not sure whats wrong. please help!

it says i have syntax errors.

com/example/BlogPost.java
package com.example;
import java.util.Date;

public class BlogPost {
private String mAuthor;
private String mTitle;
private String mBody;
private String mCategory;
private Date mCreationDate;

public BlogPost (String author, String title, String body, String category, Date creationdate){
  mAuthor = author;
  mTitle = title;
  mBody = body;
  mCategory = category;
  mCreationDate = creationdate;

}
}


private String getAuthor(){
  return mAuthor;
}

private String getTitle(){
  return mTitle;
}
private String getBody(){
  return mBody;
}
private String getCategory(){
  return mCategory;
}
private Date getCreationDate(){
  return mCreationDate;
}

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! I received your request for assistance. The problem here is curly braces. They're a bit mis-matched so it's creating syntax errors. Your constructor starts with an open curly brace, but ends with two which means it's closing off the class. Moving the closing curly brace } on line 19 to the end of the file causes the challenge to pass all three steps.

Hope this helps! :sparkles: