# Errors

Throughout your coding experience, you'll experience countless errors. It's just a part of life as a programmer. There's 3 types of errors that you'll experience:

## Syntax Errors

These errors are caused by incorrect formatting or spelling (e.g., a missing semicolon at the end of a line) and prevent your code from running at all.

### How to Solve Them

Compilers automatically underline typos with a red underline, like in the example below.&#x20;

![](https://1432020148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD93AURfj5NdwXjVDjMmD%2Fuploads%2FL6D5ldXSSaNVYCM9GSkW%2Fimage.png?alt=media\&token=02ed4cb2-8c01-47dc-a6cb-bae9db4db975)

### Runtime Errors

These errors are caused when a program attempts to run a line of code that the compiler considers impossible or invalid.

For example, let's say you tried to divide something by 0. Your code will automatically stop running, and give you a runtime error.&#x20;

Since there are so many different sources of runtime errors, when a Runtime Error is called, the code will specify why. For example, if you try to do something with a <kbd>null</kbd> object (like add a value, check if it's equal to a boolean, etc.) , it will give you a `NullPointerException`.&#x20;

### Logic Errors

Although these don't stop your code, in some cases they're even worse than the other two.&#x20;
