Fixing Errors

Now that the Spartacus application has been written, compiled, and run, it’s time to break something to get some experience with how NetBeans responds when things go terribly wrong.

Like any programmer, you’ll have plenty of practice screwing things up on your own, but pay attention here anyway.

Return to Spartacus.java in the source editor, and take the semicolon off the end of the line that calls System.out.println() (line 17 in Listing A.1). Even before you save the file, NetBeans spots the error and displays a red alert icon to the left of the line (see Figure A.5).

Figure A.5. Flagging errors in the source editor.

Image

Hover over ...

Get Sams Teach Yourself Java™ in 24 Hours, Sixth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.