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 trial

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,430 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: