Kinds of Errors

In this lesson, we will look at some of the kinds of errors programmers make.

We'll cover the following...

Syntax errors

Just like any natural language, such as English, Java has a set of rules that define it. These rules form the language’s syntax. They dictate how we form phrases and statements. If we do not follow Java’s syntax precisely, we will have made a syntax error, and our program will not compile. The compiler will produce a message that attempts to describe what we have done wrong. Most of the time, these error messages will point right to the mistake, but sometimes the messages might seem vague or even misleading. Because the compiler generates a message when it first detects that something is incorrect, it cannot always diagnose the problem specifically. However, we can be sure of one thing: The compiler is right; we made a mistake!

📝 Note
Compilers ...

Access this course and 1400+ top-rated courses and projects.