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

Amit Dhamankar
Amit Dhamankar
4,163 Points

I have 2 classes but they are not working? I am learning packages

clearimport java.util.Date;

import com.teamtreehouse.Treet;

public class Example {

public static void main(String[] args) {
  Treet treet = new Treet(
    "amitDhamankar",
    "Want to be famous? Simply tweet about Java and use" +
    " the hashtag #treet. I'll use yout tweet in a new" +
    "@treehouse code at data structures.",
     new Date(1468901376000L ));
  System.out.printf("This is a new Treet:  %s \n",treet);

}



}
                                                                                                              ```java

And the second class is

```java

package com.teamtreehouse;

public class Treet {
  private String mAuthor; 
  private String mDescription;
  private Date mCreationDate;

  public Treet(String author, String description, Date creationDate) {
    mAuthor = author;
    mDescription = description;
    mCreationDate = creationDate;
  }

  public String getAuthor() {
    return mAuthor;
  }

  public String getDescription() {
    return mDescription;
  }

  public Date getCreationDate() {
    return mCreationDate;
  }

}


I have written exactly the Craig Dennis has said but it's not working

1 Answer

Benjamin Barslev Nielsen
Benjamin Barslev Nielsen
18,958 Points

You are forgetting to import java.util.Date in the Treet class.