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 Objects Meet Objects Create a class and field

Agnes Demes
Agnes Demes
6,613 Points

cannot declaire class

I keep getting illegal start of operation error what am i missing

public class GoKart {}
GoKart.java
public class GoKart {}
Teacher Russell
Teacher Russell
16,873 Points

At this time they're looking for the class, without the public modifier.

2 Answers

Haisam Elkewidy
Haisam Elkewidy
26,987 Points

Maybe open the bracket and put the closing bracket in another line?

I tried creating a class in the challenge with the public keyword and it actually takes it just fine.

The editors in Team Treehouse can be a bit finicky sometimes, just so you know.

Teacher Russell
Teacher Russell
16,873 Points

That's a good point, Haisam. Exactly why I thought they might not be accepting it with public, even though it's not incorrect. I only remembered how I had solved the challenge weeks ago. However, I just tried it exactly the way Agnes did, and it was accepted. So.....who knows:)

Agnes Demes
Agnes Demes
6,613 Points

Thank you, Yes apperently there have been problems lately with the Java error checkers. That is causing the problem . Developers are working on the issue.