From the course: Java 8 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Understanding syntax errors vs. runtime exceptions

Understanding syntax errors vs. runtime exceptions - Java Tutorial

From the course: Java 8 Essential Training

Start my 1-month free trial

Understanding syntax errors vs. runtime exceptions

- Dealing with bugs is a common part of all software development. Before we get to much further into the Java programming language, I'll describe how to handle various kinds of errors. Both syntax errors, which you must deal with before you can compile and run your application, and run time exceptions. Those exceptions that occur while the application is running. In the empty made method, I'll start by introducing a syntax error. If you've been coding for any amount of time, I'm sure you've seen some of these. I'll declare a String that I'll name s. And I'll try to assign it to the keyword Null. Now, I'll intentionally misspell it. The keyword Null in Java is all lower case. When I type it with an upper case in, and then I try to run the application, the application doesn't even compile. Instead I get a syntax error, telling me that the compiler can't find the symbol. It means this keyword Null. And it tells me exactly where the problem is and how to deal with it. In a larger…

Contents