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 Object Inheritance

Christopher Mlalazi
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Christopher Mlalazi
Front End Web Development Techdegree Graduate 17,305 Points

Workspace is not compiling

My workspace is not compiling I copied all code exactly except for wording of the tweet which I didn't think would affect results. Is there somewhere where I have gone wrong with the code?

https://w.trhou.se/na77i8yspe

2 Answers

After following your link, I see an empty Treet class. Is that what I'm supposed to see? If so, it compiles for me. But, on the other hand, in the case that your link is bad, can you copy and paste your code here?

Christopher Mlalazi
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Christopher Mlalazi
Front End Web Development Techdegree Graduate 17,305 Points

Hi Sue, the code that is in the screen grab is all that I have. Are you saying it compiled for you?

Just in case, this is Treet.java

package com.teamtreehouse;

public class Treet {

}

and this is example.java

import com.teamtreehouse.Treet;

public class Example {

    public static void main(String[] args){
        Treet treet = new Treet();
        System.out.printf("This is a new Treet: %s %n", treet);

    }
}

Great!

But it should have compiled before with only the code you had. The output would have been the result of Java Object's toString() method since you had not yet overridden it. Maybe it was a bug in your workspace?

Anyway, I'm glad it worked out.