DEBUGGING AND AVOIDING COMMON ERRORS IN JAVA

Image

While working through this book, you’ve probably made a few typos or mistakes along the way. In this appendix, I’ll go over a few common programming pitfalls to avoid. One nice feature of both Eclipse and Android Studio that is helpful when debugging is syntax coloring. Class names, functions, variable types, strings, comments, and so on are each colored differently in the IDE based on their syntax.

Syntax coloring can help you spot typos and other problems quickly. For example, if you forget to close a string with a second pair of double quotes, the semicolon at the end of that line will be colored ...

Get Learn Java the Easy Way 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.