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.

Mark VonGyer
21,215 PointsExample.java code
Does anyone have the Example.java code before this video they could copy for me please? I've lost mine :(
2 Answers

Geoff Parsons
11,679 PointsThis is Example.java
from a new workspace at the start of this video, hope that's what you're looking for:
import java.util.Arrays;
import java.util.Date;
import com.teamtreehouse.Treet;
public class Example {
public static void main(String[] args) {
Treet treet = new Treet(
"craigsdennis",
"Want to be famous? Simply tweet about Java and use " +
"the hashtag #treet. I'll use your tweet in a new " +
"@treehouse course about data structures.",
new Date(1421849732000L)
);
Treet secondTreet = new Treet(
"journeytocode",
"@treehouse makes learning Java sooooo fun! #treet",
new Date(1421878767000L)
);
System.out.printf("This is a new Treet: %s %n", treet);
System.out.println("The words are:");
for (String word: treet.getWords()) {
System.out.println(word);
}
Treet[] treets = {treet, secondTreet};
Arrays.sort(treets);
}
}

Mark VonGyer
21,215 PointsThanks boss!