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 (Retired) Harnessing the Power of Objects Incrementing

Output.html is getting fussy...

I have only one defective line of code, yet output gives me 8 different errors. Here is the code:

./GoKart.java:24: error: illegal start of type
    return boolean mBarsCount == 0;
    ^
./GoKart.java:24: error: ';' expected
    return boolean mBarsCount == 0;
          ^
./GoKart.java:24: error:  expected
    return boolean mBarsCount == 0;
                             ^
./GoKart.java:24: error: illegal start of type
    return boolean mBarsCount == 0;
                                 ^
./GoKart.java:24: error:  expected
    return boolean mBarsCount == 0;
                                  ^
./GoKart.java:24: error: ';' expected
    return boolean mBarsCount == 0;
                                   ^
./GoKart.java:34: error: class, interface, or enum expected
}
^
./GoKart.java:24: error: cannot find symbol
    return boolean mBarsCount == 0;
                   ^
  symbol:   class mBarsCount
  location: class GoKart
8 errors

Whew. :|

2 Answers

Kevin Faust
Kevin Faust
15,353 Points

because if you forget to put a semicolon, the rest of your code after that will make no sense to the compiler and hence lots of error messages

But I had a semicolon at the end of the line...

Kevin Faust
Kevin Faust
15,353 Points

so did you fix the defective line of code?