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 Inheritance in Java Inheritance in Java Introducing Inheritance

Can not making dog object!!!

I have a issue making a dog pbject in main method Intellij said "Main.This" can not be refrenced from static context"

not allowing me to create dog object but in your video you did that !!!!!

https://w.trhou.se/ctmmcg57j4

Steven Parker
Steven Parker
231,236 Points

You can't share a direct URL to your workspace, it's temporary and only exists while you are using it. But you can use the snapshot function in the workspace and provide the link to that.

Steven Parker thanks for helping I fix that and now you can see whats happening

1 Answer

Steven Parker
Steven Parker
231,236 Points

The closing brace ("}") on line 33 is misplaced and should be moved to line 18.

As it is now, it's causing the "Dog" class to be inside the "Main" class.

Also, something happened to give a strange name to one of your other files. To fix it, do this in the console (note that there's a space after the d inside the quotes):

treehouse:~/workspace$ mv "d " Cow.java